]> git.sur5r.net Git - cc65/blob - src/ld65/objdata.h
Use gcc attribs, fixed a wrong arg
[cc65] / src / ld65 / objdata.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                 objdata.h                                 */
4 /*                                                                           */
5 /*               Handling object file data for the ld65 linker               */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 1998     Ullrich von Bassewitz                                        */
10 /*              Wacholderweg 14                                              */
11 /*              D-70597 Stuttgart                                            */
12 /* EMail:       uz@musoftware.de                                             */
13 /*                                                                           */
14 /*                                                                           */
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.                                    */
18 /*                                                                           */
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:                            */
22 /*                                                                           */
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              */
30 /*    distribution.                                                          */
31 /*                                                                           */
32 /*****************************************************************************/
33
34
35
36 #ifndef OBJDATA_H
37 #define OBJDATA_H
38
39
40
41 #include "../common/objdefs.h"
42
43
44
45 /*****************************************************************************/
46 /*                                   Data                                    */
47 /*****************************************************************************/
48
49
50
51 /* Values for the Flags field */
52 #define OBJ_REF         0x0001          /* We have a reference to this file */
53 #define OBJ_HAVEDATA    0x0002          /* We have this object file already */
54 #define OBJ_MARKED      0x0004          /* Generic marker bit */
55
56
57 /* Internal structure holding object file data */
58 typedef struct ObjData_ ObjData;
59 struct ObjData_ {
60     ObjData*            Next;           /* Linked list of all objects */
61     char*               Name;           /* Module name */
62     char*               LibName;        /* Name of library */
63     ObjHeader           Header;         /* Header of file */
64     unsigned long       Start;          /* Start offset of data in library */
65     unsigned            Flags;
66     unsigned            FileCount;      /* Input file count */
67     char**              Files;          /* List of input files */
68     unsigned            SectionCount;   /* Count of sections in this object */
69     struct Section_**   Sections;       /* List of all sections */
70     unsigned            ExportCount;    /* Count of exports */
71     struct Export_**    Exports;        /* List of all exports */
72     unsigned            ImportCount;    /* Count of imports */
73     struct Import_**    Imports;        /* List of all imports */
74     unsigned            DbgSymCount;    /* Count of debug symbols */
75     struct DbgSym_**    DbgSyms;        /* List of debug symbols */
76 };
77
78
79
80 /* Object data list management */
81 extern unsigned         ObjCount;       /* Count of files in the list */
82 extern ObjData*         ObjRoot;        /* List of object files */
83 extern ObjData*         ObjLast;        /* Last entry in list */
84
85
86
87 /*****************************************************************************/
88 /*                                   Code                                    */
89 /*****************************************************************************/
90
91
92
93 ObjData* NewObjData (void);
94 /* Allocate a new structure on the heap, insert it into the list, return it */
95
96 void FreeObjData (ObjData* O);
97 /* Free a complete struct */
98
99
100
101 /* End of objdata.h */
102
103 #endif
104
105
106