1167
1168 /*
1169 * The auxiliary symbol descriptor contains the additional information (beyond
1170 * the symbol descriptor) required to process global symbols. These symbols are
1171 * accessed via an internal symbol hash table where locality of reference is
1172 * important for performance.
1173 */
1174 struct sym_aux {
1175 APlist *sa_dfiles; /* files where symbol is defined */
1176 Sym sa_sym; /* copy of symtab entry */
1177 const char *sa_vfile; /* first unavailable definition */
1178 const char *sa_rfile; /* file with first symbol referenced */
1179 Word sa_hash; /* the pure hash value of symbol */
1180 Word sa_PLTndx; /* index into PLT for symbol */
1181 Word sa_PLTGOTndx; /* GOT entry indx for PLT indirection */
1182 Word sa_linkndx; /* index of associated symbol from */
1183 /* ET_DYN file */
1184 Half sa_symspec; /* special symbol ids */
1185 Half sa_overndx; /* output file versioning index */
1186 Half sa_dverndx; /* dependency versioning index */
1187 };
1188
1189 /*
1190 * Nodes used to track symbols in the global AVL symbol dictionary.
1191 */
1192 struct sym_avlnode {
1193 avl_node_t sav_node; /* AVL node */
1194 Word sav_hash; /* symbol hash value */
1195 const char *sav_name; /* symbol name */
1196 Sym_desc *sav_sdp; /* symbol descriptor */
1197 };
1198
1199 /*
1200 * These are the ids for processing of `Special symbols'. They are used
1201 * to set the sym->sd_aux->sa_symspec field.
1202 */
1203 #define SDAUX_ID_ETEXT 1 /* etext && _etext symbol */
1204 #define SDAUX_ID_EDATA 2 /* edata && _edata symbol */
1205 #define SDAUX_ID_END 3 /* end, _end, && _END_ symbol */
1206 #define SDAUX_ID_DYN 4 /* DYNAMIC && _DYNAMIC symbol */
1207 #define SDAUX_ID_PLT 5 /* _PROCEDURE_LINKAGE_TABLE_ symbol */
1208 #define SDAUX_ID_GOT 6 /* _GLOBAL_OFFSET_TABLE_ symbol */
1209 #define SDAUX_ID_START 7 /* START_ && _START_ symbol */
1210
1211 /*
1212 * Flags for sym_desc.sd_flags
1213 */
1214 #define FLG_SY_MVTOCOMM 0x00000001 /* assign symbol to common (.bss) */
1215 /* this is a result of a */
1216 /* copy reloc against sym */
1217 #define FLG_SY_GLOBREF 0x00000002 /* a global reference has been seen */
1218 #define FLG_SY_WEAKDEF 0x00000004 /* a weak definition has been used */
1219 #define FLG_SY_CLEAN 0x00000008 /* `Sym' entry points to original */
1220 /* input file (read-only). */
1221 #define FLG_SY_UPREQD 0x00000010 /* symbol value update is required, */
1222 /* either it's used as an entry */
1223 /* point or for relocation, but */
1224 /* it must be updated even if */
1225 /* the -s flag is in effect */
1226 #define FLG_SY_NOTAVAIL 0x00000020 /* symbol is not available to the */
1227 /* application either because it */
1228 /* originates from an implicitly */
1229 /* referenced shared object, or */
|
1167
1168 /*
1169 * The auxiliary symbol descriptor contains the additional information (beyond
1170 * the symbol descriptor) required to process global symbols. These symbols are
1171 * accessed via an internal symbol hash table where locality of reference is
1172 * important for performance.
1173 */
1174 struct sym_aux {
1175 APlist *sa_dfiles; /* files where symbol is defined */
1176 Sym sa_sym; /* copy of symtab entry */
1177 const char *sa_vfile; /* first unavailable definition */
1178 const char *sa_rfile; /* file with first symbol referenced */
1179 Word sa_hash; /* the pure hash value of symbol */
1180 Word sa_PLTndx; /* index into PLT for symbol */
1181 Word sa_PLTGOTndx; /* GOT entry indx for PLT indirection */
1182 Word sa_linkndx; /* index of associated symbol from */
1183 /* ET_DYN file */
1184 Half sa_symspec; /* special symbol ids */
1185 Half sa_overndx; /* output file versioning index */
1186 Half sa_dverndx; /* dependency versioning index */
1187 Os_desc *sa_boundsec; /* output section of SECBOUND_ syms */
1188 };
1189
1190 /*
1191 * Nodes used to track symbols in the global AVL symbol dictionary.
1192 */
1193 struct sym_avlnode {
1194 avl_node_t sav_node; /* AVL node */
1195 Word sav_hash; /* symbol hash value */
1196 const char *sav_name; /* symbol name */
1197 Sym_desc *sav_sdp; /* symbol descriptor */
1198 };
1199
1200 /*
1201 * These are the ids for processing of `Special symbols'. They are used
1202 * to set the sym->sd_aux->sa_symspec field.
1203 */
1204 #define SDAUX_ID_ETEXT 1 /* etext && _etext symbol */
1205 #define SDAUX_ID_EDATA 2 /* edata && _edata symbol */
1206 #define SDAUX_ID_END 3 /* end, _end, && _END_ symbol */
1207 #define SDAUX_ID_DYN 4 /* DYNAMIC && _DYNAMIC symbol */
1208 #define SDAUX_ID_PLT 5 /* _PROCEDURE_LINKAGE_TABLE_ symbol */
1209 #define SDAUX_ID_GOT 6 /* _GLOBAL_OFFSET_TABLE_ symbol */
1210 #define SDAUX_ID_START 7 /* START_ && _START_ symbol */
1211 #define SDAUX_ID_SECBOUND_START 8 /* __start_<section> symbols */
1212 #define SDAUX_ID_SECBOUND_STOP 9 /* __stop_<section> symbols */
1213
1214 /*
1215 * Flags for sym_desc.sd_flags
1216 */
1217 #define FLG_SY_MVTOCOMM 0x00000001 /* assign symbol to common (.bss) */
1218 /* this is a result of a */
1219 /* copy reloc against sym */
1220 #define FLG_SY_GLOBREF 0x00000002 /* a global reference has been seen */
1221 #define FLG_SY_WEAKDEF 0x00000004 /* a weak definition has been used */
1222 #define FLG_SY_CLEAN 0x00000008 /* `Sym' entry points to original */
1223 /* input file (read-only). */
1224 #define FLG_SY_UPREQD 0x00000010 /* symbol value update is required, */
1225 /* either it's used as an entry */
1226 /* point or for relocation, but */
1227 /* it must be updated even if */
1228 /* the -s flag is in effect */
1229 #define FLG_SY_NOTAVAIL 0x00000020 /* symbol is not available to the */
1230 /* application either because it */
1231 /* originates from an implicitly */
1232 /* referenced shared object, or */
|