ObjFW  Diff

Differences From Artifact [34398bab6e]:

To Artifact [32eb67f328]:


378
379
380
381
382
383
384



385
386
387
388
389
390
391
of_init(unsigned int version, struct of_libc *libc_, FILE **sF)
{
#ifdef OF_AMIGAOS_M68K
	OF_M68K_ARG(struct ObjFWBase *, base, a6)
#else
	register struct ObjFWBase *r12 __asm__("r12");
	struct ObjFWBase *base = r12;



#endif
	uintptr_t *iter, *iter0;

	if (version > 1)
		return false;

	if (base->initialized)







>
>
>







378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
of_init(unsigned int version, struct of_libc *libc_, FILE **sF)
{
#ifdef OF_AMIGAOS_M68K
	OF_M68K_ARG(struct ObjFWBase *, base, a6)
#else
	register struct ObjFWBase *r12 __asm__("r12");
	struct ObjFWBase *base = r12;
#endif
#ifdef OF_MORPHOS
	void *frame;
#endif
	uintptr_t *iter, *iter0;

	if (version > 1)
		return false;

	if (base->initialized)
401
402
403
404
405
406
407
408
409


410
411


412
413
414
415
416
417
418
	for (size_t i = 1; i <= (size_t)_EH_FRAME_BEGINS__; i++)
		__register_frame_info((&_EH_FRAME_BEGINS__)[i],
		    (&_EH_FRAME_OBJECTS__)[i]);

	iter0 = &__CTOR_LIST__[1];
#elif defined(OF_MORPHOS)
	__asm__ (
	    "lis	%0, ctors+4@ha\n\t"
	    "la		%0, ctors+4@l(%0)\n\t"


	    : "=r"(iter0)
	);


#endif

	for (iter = iter0; *iter != 0; iter++);

	while (iter > iter0) {
		void (*ctor)(void) = (void (*)(void))*--iter;
		ctor();







|
|
>
>
|

>
>







404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
	for (size_t i = 1; i <= (size_t)_EH_FRAME_BEGINS__; i++)
		__register_frame_info((&_EH_FRAME_BEGINS__)[i],
		    (&_EH_FRAME_OBJECTS__)[i]);

	iter0 = &__CTOR_LIST__[1];
#elif defined(OF_MORPHOS)
	__asm__ (
	    "lis	%0, __EH_FRAME_BEGIN__@ha\n\t"
	    "la		%0, __EH_FRAME_BEGIN__@l(%0)\n\t"
	    "lis	%1, __CTOR_LIST__@ha\n\t"
	    "la		%1, __CTOR_LIST__@l(%1)\n\t"
	    : "=r"(frame), "=r"(iter0)
	);

	libc.__register_frame(frame);
#endif

	for (iter = iter0; *iter != 0; iter++);

	while (iter > iter0) {
		void (*ctor)(void) = (void (*)(void))*--iter;
		ctor();
730
731
732
733
734
735
736




737
738

739
740
741
742
	.rt_Revision = OBJFW_LIB_MINOR,
	.rt_Tags = NULL,
#endif
};

#ifdef OF_MORPHOS
__asm__ (




    ".section .ctors, \"aw\", @progbits\n"
    "ctors:\n"

    "	.long -1\n"
    ".section .text"
);
#endif







>
>
>
>

|
>
|



737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
	.rt_Revision = OBJFW_LIB_MINOR,
	.rt_Tags = NULL,
#endif
};

#ifdef OF_MORPHOS
__asm__ (
    ".section .eh_frame, \"aw\", @progbits\n"
    ".globl __EH_FRAME_BEGIN__\n"
    ".type __EH_FRAME_BEGIN__, @object\n"
    "__EH_FRAME_BEGIN__:\n"
    ".section .ctors, \"aw\", @progbits\n"
    ".globl __CTOR_LIST__\n"
    ".type __CTOR_LIST__, @object\n"
    "__CTOR_LIST__:\n"
    ".section .text"
);
#endif