1 /*****************************************************************************/
5 /* Handling object file data for the ld65 linker */
9 /* (C) 1998 Ullrich von Bassewitz */
11 /* D-70597 Stuttgart */
12 /* EMail: uz@musoftware.de */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
46 /*****************************************************************************/
48 /*****************************************************************************/
52 /* Values for the Flags field */
53 #define OBJ_REF 0x0001 /* We have a reference to this file */
54 #define OBJ_HAVEDATA 0x0002 /* We have this object file already */
55 #define OBJ_MARKED 0x0004 /* Generic marker bit */
58 /* Internal structure holding object file data */
59 typedef struct ObjData ObjData;
61 ObjData* Next; /* Linked list of all objects */
62 char* Name; /* Module name */
63 char* LibName; /* Name of library */
64 ObjHeader Header; /* Header of file */
65 unsigned long Start; /* Start offset of data in library */
67 unsigned FileCount; /* Input file count */
68 char** Files; /* List of input files */
69 unsigned SectionCount; /* Count of sections in this object */
70 struct Section** Sections; /* List of all sections */
71 unsigned ExportCount; /* Count of exports */
72 struct Export** Exports; /* List of all exports */
73 unsigned ImportCount; /* Count of imports */
74 struct Import** Imports; /* List of all imports */
75 unsigned DbgSymCount; /* Count of debug symbols */
76 struct DbgSym** DbgSyms; /* List of debug symbols */
81 /* Object data list management */
82 extern unsigned ObjCount; /* Count of files in the list */
83 extern ObjData* ObjRoot; /* List of object files */
84 extern ObjData* ObjLast; /* Last entry in list */
88 /*****************************************************************************/
90 /*****************************************************************************/
94 ObjData* NewObjData (void);
95 /* Allocate a new structure on the heap, insert it into the list, return it */
97 void FreeObjData (ObjData* O);
98 /* Free a complete struct */
100 const char* GetObjFileName (const ObjData* O);
101 /* Get the name of the object file. Return "[linker generated]" if the object
105 const char* GetSourceFileName (const ObjData* O, unsigned Index);
106 /* Get the name of the source file with the given index. If O is NULL, return
107 * "[linker generated]" as the file name.
112 /* End of objdata.h */