Export* CreateSectionExport (unsigned Name, Section* Sec, unsigned long Offs) /* Create a relative export to a section */ { /* Create a new export */ Export* E = NewExport (EXP_EXPR | EXP_LABEL, Sec->AddrSize, Name, 0); /* Assign the value */ E->Expr = SectionExpr (Sec, Offs, 0); /* Insert the export */ InsertExport (E); /* Return the new export */ return E; }
Export* CreateMemoryExport (unsigned Name, Memory* Mem, unsigned long Offs) /* Create an relative export for a memory area offset */ { /* Create a new export */ Export* E = NewExport (EXP_EXPR | EXP_LABEL, ADDR_SIZE_ABS, Name, 0); /* Assign the value */ E->Expr = MemoryExpr (Mem, Offs, 0); /* Insert the export */ InsertExport (E); /* Return the new export */ return E; }
Export* CreateConstExport (unsigned Name, long Value) /* Create an export for a literal date */ { /* Create a new export */ Export* E = NewExport (EXP_CONST | EXP_EQUATE, ADDR_SIZE_ABS, Name, 0); /* Assign the value */ E->Expr = LiteralExpr (Value, 0); /* Insert the export */ InsertExport (E); /* Return the new export */ return E; }
Export* CreateSegmentExport (unsigned Name, Segment* Seg, unsigned long Offs) /* Create a relative export to a segment */ { /* Create a new export */ Export* E = NewExport (SYM_EXPR | SYM_LABEL, Seg->AddrSize, Name, 0); /* Assign the value */ E->Expr = SegmentExpr (Seg, Offs, 0); /* Insert the export */ InsertExport (E); /* Return the new export */ return E; }
Export* CreateExprExport (unsigned Name, ExprNode* Expr, unsigned char AddrSize) /* Create an export for an expression */ { /* Create a new export */ Export* E = NewExport (SYM_EXPR|SYM_EQUATE, AddrSize, Name, 0); /* Assign the value expression */ E->Expr = Expr; /* Insert the export */ InsertExport (E); /* Return the new export */ return E; }
void InsertObjGlobals (ObjData* O) /* Insert imports and exports from the object file into the global import and * export lists. */ { unsigned I; /* Insert exports and imports */ for (I = 0; I < CollCount (&O->Exports); ++I) { InsertExport (CollAt (&O->Exports, I)); } for (I = 0; I < CollCount (&O->Imports); ++I) { InsertImport (CollAt (&O->Imports, I)); } }