History

Simplify and fix GOT32 + PLT32 reloc commit

Introduce a new attribute to check the existence of a PLT entry for a given symbol has the presence of an entry for that symbol in the dynsym section is not proof that a PLT entry exists. This fixes commit dc8ea93b13faefb565fb937f8b8c08c40c063549.

Thomas Preud'homme committed 12 years ago

Commit aa561d71 parent bed86522 files · +3 −3Browse files

Unified · Split

2 files
  1. tcc.h +1 −0
  2. tccelf.c +2 −3
tcc.h+1−0
@@ -522,6 +522,7 @@ typedef struct ASMOperand { · 521 unmodified lines
522522
523523 struct sym_attr {
524524 unsigned long got_offset;
525+ unsigned char has_plt_entry:1;
525526 #ifdef TCC_TARGET_ARM
526527 unsigned char plt_thumb_stub:1;
527528 #endif
tccelf.c+2−3
@@ -1042,10 +1042,9 @@ static void put_got_entry(TCCState *s1, · 1041 unmodified lines
10421042 if (s1->dynsym) {
10431043 sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
10441044 name = (char *) symtab_section->link->data + sym->st_name;
1045− if (!find_elf_sym(s1->dynsym, name))
1046− need_plt_entry = 1;
1047− else
1045+ if (s1->sym_attrs[sym_index].has_plt_entry)
10481046 return;
1047+ s1->sym_attrs[sym_index].has_plt_entry = 1;
10491048 offset = sym->st_value;
10501049 #if defined(TCC_TARGET_I386) || defined(TCC_TARGET_X86_64)
10511050 if (need_plt_entry) {

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