History

Control symbol table of which to relocate symbols

Pass pointer to symbol table to relocate the symbols of in relocate_syms

Thomas Preud'homme committed 10 years ago

Commit 097cf3a1 parent c4bec034 files · +6 −6Browse files

Unified · Split

4 files
  1. tcc.h +1 −1
  2. tccelf.c +3 −3
  3. tccpe.c +1 −1
  4. tccrun.c +1 −1
tcc.h+1−1
@@ -1375,7 +1375,7 @@ ST_FUNC void put_stabn(int type, int other, int desc, int value); · 1374 unmodified lines
13751375 ST_FUNC void put_stabd(int type, int other, int desc);
13761376
13771377 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);
13791379 ST_FUNC void relocate_section(TCCState *s1, Section *s);
13801380 ST_FUNC void relocate_plt(TCCState *s1);
13811381
tccelf.c+3−3
@@ -652,13 +652,13 @@ ST_FUNC void relocate_common_syms(void) · 651 unmodified lines
652652
653653 /* relocate symbol table, resolve undefined symbols if do_resolve is
654654 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)
656656 {
657657 ElfW(Sym) *sym;
658658 int sym_bind, sh_num;
659659 const char *name;
660660
661− for_each_elem(symtab_section, 1, sym, ElfW(Sym)) {
661+ for_each_elem(symtab, 1, sym, ElfW(Sym)) {
662662 sh_num = sym->st_shndx;
663663 if (sh_num == SHN_UNDEF) {
664664 name = (char *) strtab_section->data + sym->st_name;
@@ -1898,7 +1898,7 @@ static int final_sections_reloc(TCCState *s1) · 1233 unmodified lines
18981898 int i;
18991899 Section *s;
19001900
1901− relocate_syms(s1, 0);
1901+ relocate_syms(s1, s1->symtab, 0);
19021902
19031903 if (s1->nb_errors != 0)
19041904 return -1;
tccpe.c+1−1
@@ -1872,7 +1872,7 @@ ST_FUNC int pe_output_file(TCCState *s1, const char *filename) · 1871 unmodified lines
18721872 ;
18731873 else if (filename) {
18741874 pe_assign_addresses(&pe);
1875− relocate_syms(s1, 0);
1875+ relocate_syms(s1, s1->symtab, 0);
18761876 for (i = 1; i < s1->nb_sections; ++i) {
18771877 Section *s = s1->sections[i];
18781878 if (s->reloc) {
tccrun.c+1−1
@@ -211,7 +211,7 @@ static int tcc_relocate_ex(TCCState *s1, void *ptr) · 210 unmodified lines
211211 }
212212
213213 /* relocate symbols */
214− relocate_syms(s1, 1);
214+ relocate_syms(s1, s1->symtab, 1);
215215 if (s1->nb_errors)
216216 return -1;
217217

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t