@@ -13,24 +13,26 @@ * file. */ #include "config.h" -#include -#include -#include -#include - #import "OFDNSResourceRecord.h" #import "OFHTTPRequest.h" #import "OFSocket.h" #import "OFStdIOStream.h" #import "OFString.h" -#import "amiga-library.h" #import "macros.h" +#import "amiga-glue.h" +#import "amiga-library.h" + +#include +#include +#include +#include + #define CONCAT_VERSION2(major, minor) #major "." #minor #define CONCAT_VERSION(major, minor) CONCAT_VERSION2(major, minor) #define VERSION_STRING CONCAT_VERSION(OBJFW_LIB_MAJOR, OBJFW_LIB_MINOR) #if defined(OF_AMIGAOS_M68K) @@ -49,10 +51,18 @@ int _start(void) { return -1; } + +#ifdef OF_AMIGAOS_M68K +void +__init_eh(void) +{ + /* Taken care of by OFInit() */ +} +#endif struct ObjFWBase { struct Library library; void *segList; struct ObjFWBase *parent; @@ -64,26 +74,15 @@ extern uintptr_t __CTOR_LIST__[]; extern const void *_EH_FRAME_BEGINS__; extern void *_EH_FRAME_OBJECTS__; #endif -#include "amiga-glue.h" - -#ifdef OF_AMIGAOS_M68K -void -__init_eh(void) -{ - /* Taken care of by OFInit() */ -} -#endif - #ifdef OF_MORPHOS const ULONG __abox__ = 1; #endif struct ExecBase *SysBase; struct OFLibC libC; -FILE **__sF; #if defined(OF_AMIGAOS_M68K) __asm__ ( ".text\n" ".globl ___restore_a4\n" @@ -171,12 +170,12 @@ return dataDataRelocs; } static struct Library * -libInit(struct ObjFWBase *base OF_M68K_REG(d0), void *segList OF_M68K_REG(a0), - struct ExecBase *sysBase OF_M68K_REG(a6)) +libInit(struct ObjFWBase *base OF_M68K_REG(d0), + void *segList OF_M68K_REG(a0), struct ExecBase *sysBase OF_M68K_REG(a6)) { #if defined(OF_AMIGAOS_M68K) __asm__ __volatile__ ( "move.l a6, _SysBase" :: "a"(sysBase) @@ -328,11 +327,11 @@ { return NULL; } bool -OFInit(unsigned int version, struct OFLibC *libC_, FILE **sF) +OFInit(unsigned int version, struct OFLibC *libC_) { #ifdef OF_AMIGAOS_M68K OF_M68K_ARG(struct ObjFWBase *, base, a6) #else register struct ObjFWBase *r12 __asm__("r12"); @@ -348,11 +347,10 @@ if (base->initialized) return true; memcpy(&libC, libC_, sizeof(libC)); - __sF = sF; #ifdef OF_AMIGAOS_M68K for (void *const *frame = _EH_FRAME_BEGINS__, **object = _EH_FRAME_OBJECTS__; *frame != NULL;) libC.__register_frame_info(*frame++, *object++); @@ -716,11 +714,11 @@ .rt_Revision = OBJFW_LIB_MINOR, .rt_Tags = NULL, #endif }; -#ifdef OF_MORPHOS +#if defined(OF_MORPHOS) __asm__ ( ".section .eh_frame, \"aw\"\n" ".globl __EH_FRAME_BEGIN__\n" ".type __EH_FRAME_BEGIN__, @object\n" "__EH_FRAME_BEGIN__:\n" @@ -727,7 +725,23 @@ ".section .ctors, \"aw\"\n" ".globl __CTOR_LIST__\n" ".type __CTOR_LIST__, @object\n" "__CTOR_LIST__:\n" ".section .text" +); +#elif defined(OF_AMIGAOS_M68K) +__asm__ ( + ".section .list___EH_FRAME_BEGINS__, \"aw\"\n" + ".globl __EH_FRAME_BEGIN__\n" + ".type __EH_FRAME_BEGIN__, @object\n" + "__EH_FRAME_BEGINS__:\n" + ".section .dlist___EH_FRAME_OBJECTS__, \"aw\"\n" + ".globl __EH_FRAME_OBJECTS__\n" + ".type __EH_FRAME_OBJECTS__, @object\n" + "__EH_FRAME_OBJECTS__:\n" + ".section .list___CTOR_LIST__, \"aw\"\n" + ".globl ___CTOR_LIST__\n" + ".type ___CTOR_LIST__, @object\n" + "___CTOR_LIST__:\n" + ".section .text" ); #endif