MWCC/includes/compiler/ObjGenMachO.h

76 lines
3.4 KiB
C

#ifndef COMPILER_OBJGENMACHO_H
#define COMPILER_OBJGENMACHO_H
#include "compiler/common.h"
#include "compiler/MachO.h"
typedef enum MWReloc {
MW_RELOC_0 = 0,
MW_RELOC_2_BR24 = 2,
MW_RELOC_3 = 3,
MW_RELOC_4 = 4,
MW_RELOC_5_LO16 = 5,
MW_RELOC_6_HI16 = 6,
MW_RELOC_7_HA16 = 7,
MW_RELOC_8 = 8,
MW_RELOC_9 = 9
} MWReloc;
extern Boolean declare_readonly;
extern SInt32 symdeclend;
extern SInt32 symdecloffset;
// this conflicts with other files
//extern SInt32 nexttypeid;
extern GList symtypemodule;
extern SInt32 last_base_offset[N_SECTIONS];
extern MachOSection *Sections[N_SECTIONS];
extern Section last_function_sect_id;
extern MachOSection *last_function_sect;
extern SInt32 pic_base_offset;
extern SInt32 ObjGen_MakeSectReloc(MachOSection *section);
extern SInt32 ObjGen_GetHashNodeRelocID(Object *object, MachOSection *section, SInt32 value);
extern void ObjGen_Setup(void);
extern void ObjGen_DeclareFloatConst(Object *object);
extern void ObjGen_DeclareVectorConst(Object *object);
extern void ObjGen_Finish(void);
extern void ObjGen_Cleanup(void);
extern void ObjGen_SetupSym(void);
extern void ObjGen_DeclareData(Object *object, char *data, OLinkList *olinklist, UInt32 size);
extern void ObjGen_DeclareReadOnlyData(Object *object, char *data, OLinkList *olinklist, UInt32 size);
extern void ObjGen_SegmentName(void);
extern void ObjGen_SymFunc(Object *function);
extern void ObjGenMach_SymFuncEnd(Object *function, UInt32 offset);
extern void ObjGen_CodeSetup(void);
extern void ObjGen_CodeCleanup(void);
extern void ObjGen_SrcBreakName(HashNameNode *name, SInt32 fileModDate, Boolean flag);
extern GList *ObjGen_GetSectionGList(MachOSection *section);
extern MachOSection *ObjGen_DeclareFunction(Object *object);
extern MachOSection *ObjGen_DeclareCode(Object *object);
extern MachOSection *ObjGen_DeclareMachSection();
extern void ObjGen_Relocate(MachOSection *section, SInt32 offset, SInt32 relocID, RelocType relocType, MWReloc mwRelType);
extern void ObjGen_RelocateObj(MachOSection *section, SInt32 offset, Object *object, MWReloc mwRelType);
extern SInt32 ObjGen_DeclareLiteralString(UInt32 len, char *data, SInt32 align);
extern UInt32 ObjGen_GetSectSize(MachOSection *section);
extern void ObjGen_GetExtName(SInt32 id, char *buf);
extern void ObjGen_PicRelocate(MachOSection *section, SInt32 offset, SInt32 relocID, SInt32 picOffset);
extern SInt32 ObjGen_GetRelocOffset(SInt32 id);
extern Boolean ObjGen_IsExternalVar(SInt32 id);
extern SInt32 ObjGen_DeclareInit(UInt32 len, char *data, SInt32 align);
extern void CodeGen_GenDynLinkStub(MachOSection *a, MachOSection *b, SInt32 relocID);
extern void ObjGen_DeclarePICBase(Object *object, SInt32 offset);
extern void ObjGen_DeclareEntry(Object *object, SInt32 offset);
extern void ObjGen_DeclareExceptionTables(Object *object, SInt32 codesize, char *data, SInt32 len, OLinkList *refs);
extern void ObjGen_DeclareCodeLabel(Object *labelobj, SInt32 offset, Object *funcobj);
extern void ObjGen_DeclareSwitchTable(Object *tableobj, Object *funcobj);
extern void ObjGen_DeclareTracebackTable(Object *tableobj, void *data, SInt32 size);
extern void ObjGen_DeclareSymInfo(void);
extern void ObjGen_Line(UInt32 line, UInt32 offset);
extern void ObjGen_OutputDebugInfo(Object *funcobj);
extern SInt32 ObjGen_OutputStab(SymbolData *symbol, SInt32 strIdx);
extern void ObjGen_SetSectName();
extern void ObjGen_DeclareInitFunction(Object *funcobj);
extern Boolean ObjGen_IsExported(Object *object);
#endif