Changeset View
Changeset View
Standalone View
Standalone View
contrib/gdb/gdb/coff-pe-read.c
Show First 20 Lines • Show All 290 Lines • ▼ Show 20 Lines | read_pe_exported_syms (struct objfile *objfile) | ||||
nexp = pe_as32 (expdata + 24); | nexp = pe_as32 (expdata + 24); | ||||
name_rvas = pe_as32 (expdata + 32); | name_rvas = pe_as32 (expdata + 32); | ||||
ordinals = pe_as32 (expdata + 36); | ordinals = pe_as32 (expdata + 36); | ||||
ordbase = pe_as32 (expdata + 16); | ordbase = pe_as32 (expdata + 16); | ||||
exp_funcbase = pe_as32 (expdata + 28); | exp_funcbase = pe_as32 (expdata + 28); | ||||
/* Use internal dll name instead of full pathname. */ | /* Use internal dll name instead of full pathname. */ | ||||
dll_name = pe_as32 (expdata + 12) + erva; | dll_name = (char *)(pe_as32 (expdata + 12) + erva); | ||||
bfd_map_over_sections (dll, get_section_vmas, section_data); | bfd_map_over_sections (dll, get_section_vmas, section_data); | ||||
/* Adjust the vma_offsets in case this PE got relocated. This | /* Adjust the vma_offsets in case this PE got relocated. This | ||||
assumes that *all* sections share the same relocation offset | assumes that *all* sections share the same relocation offset | ||||
as the text section. */ | as the text section. */ | ||||
for (i = 0; i < PE_SECTION_TABLE_SIZE; i++) | for (i = 0; i < PE_SECTION_TABLE_SIZE; i++) | ||||
{ | { | ||||
Show All 20 Lines | for (i = 0; i < nexp; i++) | ||||
/* Find this symbol's section in our own array. */ | /* Find this symbol's section in our own array. */ | ||||
int sectix = 0; | int sectix = 0; | ||||
for (sectix = 0; sectix < PE_SECTION_TABLE_SIZE; ++sectix) | for (sectix = 0; sectix < PE_SECTION_TABLE_SIZE; ++sectix) | ||||
{ | { | ||||
if ((func_rva >= section_data[sectix].rva_start) | if ((func_rva >= section_data[sectix].rva_start) | ||||
&& (func_rva < section_data[sectix].rva_end)) | && (func_rva < section_data[sectix].rva_end)) | ||||
{ | { | ||||
add_pe_exported_sym (erva + name_rva, | add_pe_exported_sym ((char *)(erva + name_rva), | ||||
func_rva, | func_rva, | ||||
section_data + sectix, dll_name, objfile); | section_data + sectix, dll_name, objfile); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
/* discard expdata. */ | /* discard expdata. */ | ||||
do_cleanups (back_to); | do_cleanups (back_to); | ||||
} | } |