equal
deleted
inserted
replaced
157 void InitSymbolsLists(Elf32_Ehdr * eh,Elf32_Shdr * shdr,int shnum) |
157 void InitSymbolsLists(Elf32_Ehdr * eh,Elf32_Shdr * shdr,int shnum) |
158 { |
158 { |
159 Elf32_Sym * symtab = 0; |
159 Elf32_Sym * symtab = 0; |
160 int nSyms = 0; |
160 int nSyms = 0; |
161 char * strtab = 0; |
161 char * strtab = 0; |
162 int i=0; |
162 int i = 0; |
163 |
163 |
164 for (i = 0; (i < shnum); i++) { |
164 for (i = 0; (i < shnum); i++) { |
165 if (shdr[i].sh_type == SHT_SYMTAB) { |
165 if (shdr[i].sh_type == SHT_SYMTAB) { |
166 symtab = ELFADDR(Elf32_Sym, eh, shdr[i].sh_offset); |
166 symtab = ELFADDR(Elf32_Sym, eh, shdr[i].sh_offset); |
167 nSyms = shdr[i].sh_size / shdr[i].sh_entsize; |
167 nSyms = shdr[i].sh_size / shdr[i].sh_entsize; |
168 strtab = ELFADDR(char, eh, shdr[shdr[i].sh_link].sh_offset); |
168 strtab = ELFADDR(char, eh, shdr[shdr[i].sh_link].sh_offset); |
281 void PrintABIv2ExportSymbols(Elf32_Ehdr *eh) |
281 void PrintABIv2ExportSymbols(Elf32_Ehdr *eh) |
282 { |
282 { |
283 int shoff = eh->e_shoff; // offset of section header table |
283 int shoff = eh->e_shoff; // offset of section header table |
284 if (shoff) { |
284 if (shoff) { |
285 Elf32_Shdr * shdr = ELFADDR(Elf32_Shdr, eh, shoff); |
285 Elf32_Shdr * shdr = ELFADDR(Elf32_Shdr, eh, shoff); |
286 int i=0; |
|
287 |
286 |
288 int shnum = eh->e_shnum; // number of section headers |
287 int shnum = eh->e_shnum; // number of section headers |
289 |
288 |
290 // e_shnum will be 0 if the number of sections is >= SHN_LORESERVE (0xff00) |
289 // e_shnum will be 0 if the number of sections is >= SHN_LORESERVE (0xff00) |
291 // If this is the case, sh_size contains the actual number of section headers. |
290 // If this is the case, sh_size contains the actual number of section headers. |
305 |
304 |
306 //Get the symbol table |
305 //Get the symbol table |
307 Elf32_Sym * symtab = 0; |
306 Elf32_Sym * symtab = 0; |
308 int nSyms = 0; |
307 int nSyms = 0; |
309 char * strtab = 0; |
308 char * strtab = 0; |
310 |
309 int i = 0; |
|
310 |
311 for (i = 0; (i < shnum); i++) { |
311 for (i = 0; (i < shnum); i++) { |
312 if (shdr[i].sh_type == SHT_DYNSYM) { |
312 if (shdr[i].sh_type == SHT_DYNSYM) { |
313 symtab = ELFADDR(Elf32_Sym, eh, shdr[i].sh_offset); |
313 symtab = ELFADDR(Elf32_Sym, eh, shdr[i].sh_offset); |
314 nSyms = shdr[i].sh_size / shdr[i].sh_entsize; |
314 nSyms = shdr[i].sh_size / shdr[i].sh_entsize; |
315 strtab = ELFADDR(char, eh, shdr[shdr[i].sh_link].sh_offset); |
315 strtab = ELFADDR(char, eh, shdr[shdr[i].sh_link].sh_offset); |
348 if (!shnum) |
348 if (!shnum) |
349 shnum = shdr->sh_size; |
349 shnum = shdr->sh_size; |
350 |
350 |
351 int shstrndx = eh->e_shstrndx; |
351 int shstrndx = eh->e_shstrndx; |
352 char *aSHdrStrTab = ELFADDR(char, eh, shdr[shstrndx].sh_offset); |
352 char *aSHdrStrTab = ELFADDR(char, eh, shdr[shstrndx].sh_offset); |
353 int i=0; |
353 int i; |
354 Elf32_Verdef *aVerDef = 0; |
354 Elf32_Verdef *aVerDef = 0; |
355 char *aStringTab = 0; |
355 char *aStringTab = 0; |
356 for(i = 0; i < shnum; i++) { |
356 for(i = 0; i < shnum; i++) { |
357 if(strcmp(aSHdrStrTab + shdr[i].sh_name, ".version_d") == 0) { |
357 if(strcmp(aSHdrStrTab + shdr[i].sh_name, ".version_d") == 0) { |
358 aVerDef = ELFADDR(Elf32_Verdef,eh , shdr[i].sh_offset ); |
358 aVerDef = ELFADDR(Elf32_Verdef,eh , shdr[i].sh_offset ); |