30 |
Elf32_Phdr pheader; |
Elf32_Phdr pheader; |
31 |
Elf32_Ehdr eheader; |
Elf32_Ehdr eheader; |
32 |
Elf32_Sym *symbol_table; |
Elf32_Sym *symbol_table; |
33 |
int text_index,data_index,bss_index; |
int text_index,data_index,bss_index,sbss_index; |
34 |
#undef SYM_NAME |
#undef SYM_NAME |
35 |
#undef EXT_and_TEXT_BSS_DAT |
#undef EXT_and_TEXT_BSS_DAT |
36 |
|
|
175 |
my_string_table = get_section(fp,".strtab"); |
my_string_table = get_section(fp,".strtab"); |
176 |
text_index = get_section_number(".text"); |
text_index = get_section_number(".text"); |
177 |
bss_index = get_section_number(".bss"); |
bss_index = get_section_number(".bss"); |
178 |
|
sbss_index = get_section_number(".sbss"); |
179 |
data_index = get_section_number(".data"); |
data_index = get_section_number(".data"); |
180 |
|
|
181 |
fclose(fp); |
fclose(fp); |
190 |
(p->st_shndx == text_index \ |
(p->st_shndx == text_index \ |
191 |
|| p->st_shndx == data_index\ |
|| p->st_shndx == data_index\ |
192 |
|| p->st_shndx == bss_index \ |
|| p->st_shndx == bss_index \ |
193 |
|
|| p->st_shndx == sbss_index \ |
194 |
|| p->st_shndx == SHN_UNDEF \ |
|| p->st_shndx == SHN_UNDEF \ |
195 |
)) |
)) |
196 |
#define SYM_NAME(p) my_string_table+(p->st_name) |
#define SYM_NAME(p) my_string_table+(p->st_name) |
226 |
files to be loaded do NOT have this tacked on. |
files to be loaded do NOT have this tacked on. |
227 |
*/ |
*/ |
228 |
if (name ) { |
if (name ) { |
229 |
char *tmp; |
char *tmp; |
230 |
tmp=index(name,'@') ; |
tmp=index(name,'@') ; |
231 |
if (name |
if (name |
232 |
&& tmp |
&& tmp |
233 |
&& tmp[1]=='@' |
&& tmp[1]=='@' |
234 |
&& tmp[2]=='G' |
&& tmp[2]=='G' |
235 |
&& tmp[3]=='L' |
&& tmp[3]=='L' |
236 |
&& tmp[4]=='I') |
&& tmp[4]=='I') { |
237 |
{ *tmp=0; } |
*tmp=0; |
238 |
|
|
239 |
|
/* Some glibc have _setjmp as a strong symbol. We will need |
240 |
|
__sigsetjmp, to which _setjmp apparently points, to run |
241 |
|
properly */ |
242 |
|
|
243 |
|
if (!(strcmp(name,"_setjmp"))) |
244 |
|
name="__sigsetjmp"; |
245 |
|
|
246 |
|
} |
247 |
} |
} |
248 |
|
|
249 |
{ dprintf(tab.n_symbols %d , tab.n_symbols); |
{ dprintf(tab.n_symbols %d , tab.n_symbols); |