diff options
| author | Thomas Preud'homme <robotux@celest.fr> | 2014-03-26 22:13:20 +0800 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2014-03-26 23:13:28 +0800 |
| commit | aa561d70119accb59a17f10f9ba69076fb0ab516 (patch) | |
| tree | 1641d7dc0019c31e502f971faea8a01176928532 /tccelf.c | |
| parent | bed865275db3161375b9b082945323c68c4c5b69 (diff) | |
| download | tinycc-aa561d70119accb59a17f10f9ba69076fb0ab516.tar.gz tinycc-aa561d70119accb59a17f10f9ba69076fb0ab516.tar.bz2 | |
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.
Diffstat (limited to 'tccelf.c')
| -rw-r--r-- | tccelf.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1042,10 +1042,9 @@ static void put_got_entry(TCCState *s1, if (s1->dynsym) { sym = &((ElfW(Sym) *)symtab_section->data)[sym_index]; name = (char *) symtab_section->link->data + sym->st_name; - if (!find_elf_sym(s1->dynsym, name)) - need_plt_entry = 1; - else + if (s1->sym_attrs[sym_index].has_plt_entry) return; + s1->sym_attrs[sym_index].has_plt_entry = 1; offset = sym->st_value; #if defined(TCC_TARGET_I386) || defined(TCC_TARGET_X86_64) if (need_plt_entry) { |
