Pass pointer to symbol table to relocate the symbols of in relocate_syms
Unified · Split
| @@ -1375,7 +1375,7 @@ ST_FUNC void put_stabn(int type, int other, int desc, int value); · 1374 unmodified lines | ||
| 1375 | 1375 | ST_FUNC void put_stabd(int type, int other, int desc); |
| 1376 | 1376 | |
| 1377 | 1377 | ST_FUNC void relocate_common_syms(void); |
| 1378 | −ST_FUNC void relocate_syms(TCCState *s1, int do_resolve); | |
| 1378 | +ST_FUNC void relocate_syms(TCCState *s1, Section *symtab, int do_resolve); | |
| 1379 | 1379 | ST_FUNC void relocate_section(TCCState *s1, Section *s); |
| 1380 | 1380 | ST_FUNC void relocate_plt(TCCState *s1); |
| 1381 | 1381 | |
| @@ -652,13 +652,13 @@ ST_FUNC void relocate_common_syms(void) · 651 unmodified lines | ||
| 652 | 652 | |
| 653 | 653 | /* relocate symbol table, resolve undefined symbols if do_resolve is |
| 654 | 654 | true and output error if undefined symbol. */ |
| 655 | −ST_FUNC void relocate_syms(TCCState *s1, int do_resolve) | |
| 655 | +ST_FUNC void relocate_syms(TCCState *s1, Section *symtab, int do_resolve) | |
| 656 | 656 | { |
| 657 | 657 | ElfW(Sym) *sym; |
| 658 | 658 | int sym_bind, sh_num; |
| 659 | 659 | const char *name; |
| 660 | 660 | |
| 661 | − for_each_elem(symtab_section, 1, sym, ElfW(Sym)) { | |
| 661 | + for_each_elem(symtab, 1, sym, ElfW(Sym)) { | |
| 662 | 662 | sh_num = sym->st_shndx; |
| 663 | 663 | if (sh_num == SHN_UNDEF) { |
| 664 | 664 | name = (char *) strtab_section->data + sym->st_name; |
| @@ -1898,7 +1898,7 @@ static int final_sections_reloc(TCCState *s1) · 1233 unmodified lines | ||
| 1898 | 1898 | int i; |
| 1899 | 1899 | Section *s; |
| 1900 | 1900 | |
| 1901 | − relocate_syms(s1, 0); | |
| 1901 | + relocate_syms(s1, s1->symtab, 0); | |
| 1902 | 1902 | |
| 1903 | 1903 | if (s1->nb_errors != 0) |
| 1904 | 1904 | return -1; |
| @@ -1872,7 +1872,7 @@ ST_FUNC int pe_output_file(TCCState *s1, const char *filename) · 1871 unmodified lines | ||
| 1872 | 1872 | ; |
| 1873 | 1873 | else if (filename) { |
| 1874 | 1874 | pe_assign_addresses(&pe); |
| 1875 | − relocate_syms(s1, 0); | |
| 1875 | + relocate_syms(s1, s1->symtab, 0); | |
| 1876 | 1876 | for (i = 1; i < s1->nb_sections; ++i) { |
| 1877 | 1877 | Section *s = s1->sections[i]; |
| 1878 | 1878 | if (s->reloc) { |
| @@ -211,7 +211,7 @@ static int tcc_relocate_ex(TCCState *s1, void *ptr) · 210 unmodified lines | ||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /* relocate symbols */ |
| 214 | − relocate_syms(s1, 1); | |
| 214 | + relocate_syms(s1, s1->symtab, 1); | |
| 215 | 215 | if (s1->nb_errors) |
| 216 | 216 | return -1; |
| 217 | 217 | |