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
522 522
523struct sym_attr {523struct sym_attr {
524 unsigned long got_offset;524 unsigned long got_offset;
525 unsigned char has_plt_entry:1;
525#ifdef TCC_TARGET_ARM526#ifdef TCC_TARGET_ARM
526 unsigned char plt_thumb_stub:1;527 unsigned char plt_thumb_stub:1;
527#endif528#endif
tccelf.c+2−3
@@ -1042,10 +1042,9 @@ static void put_got_entry(TCCState *s1, · 1041 unmodified lines
1042 if (s1->dynsym) {1042 if (s1->dynsym) {
1043 sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];1043 sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
1044 name = (char *) symtab_section->link->data + sym->st_name;1044 name = (char *) symtab_section->link->data + sym->st_name;
1045 if (!find_elf_sym(s1->dynsym, name))1045 if (s1->sym_attrs[sym_index].has_plt_entry)
1046 need_plt_entry = 1;
1047 else
1048 return;1046 return;
1047 s1->sym_attrs[sym_index].has_plt_entry = 1;
1049 offset = sym->st_value;1048 offset = sym->st_value;
1050#if defined(TCC_TARGET_I386) || defined(TCC_TARGET_X86_64)1049#if defined(TCC_TARGET_I386) || defined(TCC_TARGET_X86_64)
1051 if (need_plt_entry) {1050 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