1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team, 2000
7 * ---------------------------------------------------------------------------*/
9 #ifndef LINKERINTERNALS_H
10 #define LINKERINTERNALS_H
12 typedef enum { OBJECT_LOADED, OBJECT_RESOLVED } OStatus;
14 /* Indication of section kinds for loaded objects. Needed by
15 the GC for deciding whether or not a pointer on the stack
19 enum { SECTIONKIND_CODE_OR_RODATA,
22 SECTIONKIND_NOINFOAVAIL }
30 struct _Section* next;
35 struct _ProddableBlock {
38 struct _ProddableBlock* next;
42 /* Jump Islands are sniplets of machine code required for relative
43 * address relocations on the PowerPC.
45 #ifdef powerpc_HOST_ARCH
47 short lis_r12, hi_addr;
48 short ori_r12_r12, lo_addr;
54 /* Top-level structure for an object module. One of these is allocated
55 * for each object file in use.
57 typedef struct _ObjectCode {
61 char* formatName; /* eg "ELF32", "DLL", "COFF", etc. */
63 /* An array containing ptrs to all the symbol names copied from
64 this object into the global symbol hash table. This is so that
65 we know which parts of the latter mapping to nuke when this
66 object is removed from the system. */
70 /* ptr to malloc'd lump of memory holding the obj file */
74 /* record by how much image has been deliberately misaligned
75 after allocation, so that we can use realloc */
79 /* The section-kind entries for this object module. Linked
83 /* A private hash table for local symbols. */
86 /* Allow a chain of these things */
87 struct _ObjectCode * next;
89 /* SANITY CHECK ONLY: a list of the only memory regions which may
90 safely be prodded during relocation. Any attempt to prod
91 outside one of these is an error in the linker. */
92 ProddableBlock* proddables;
95 /* Procedure Linkage Table for this object */
97 unsigned int pltIndex;
100 #ifdef powerpc_HOST_ARCH
101 ppcJumpIsland *jump_islands;
102 unsigned long island_start_symbol;
103 unsigned long n_islands;
108 extern ObjectCode *objects;
110 #endif /* LINKERINTERNALS_H */