Set plt_got.offset to (bfd_vma) -1

Since plt_got.offset may be updated in x86 allocate_dynrelocs, set
plt_got.offset to (bfd_vma) -1 when setting needs_plt to 0.

	* elf32-i386.c (elf_i386_allocate_dynrelocs): Set plt_got.offset
	to (bfd_vma) -1 when setting needs_plt to 0.
	* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
This commit is contained in:
H.J. Lu
2016-02-24 05:42:27 -08:00
parent bf74e428bc
commit 13f422778f
3 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2016-02-24 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_allocate_dynrelocs): Set plt_got.offset
to (bfd_vma) -1 when setting needs_plt to 0.
* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
2016-02-23 H.J. Lu <hongjiu.lu@intel.com> 2016-02-23 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (bfd_elf_record_link_assignment): Check for shared * elflink.c (bfd_elf_record_link_assignment): Check for shared

View File

@ -2490,12 +2490,14 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
} }
else else
{ {
eh->plt_got.offset = (bfd_vma) -1;
h->plt.offset = (bfd_vma) -1; h->plt.offset = (bfd_vma) -1;
h->needs_plt = 0; h->needs_plt = 0;
} }
} }
else else
{ {
eh->plt_got.offset = (bfd_vma) -1;
h->plt.offset = (bfd_vma) -1; h->plt.offset = (bfd_vma) -1;
h->needs_plt = 0; h->needs_plt = 0;
} }

View File

@ -2723,12 +2723,14 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
} }
else else
{ {
eh->plt_got.offset = (bfd_vma) -1;
h->plt.offset = (bfd_vma) -1; h->plt.offset = (bfd_vma) -1;
h->needs_plt = 0; h->needs_plt = 0;
} }
} }
else else
{ {
eh->plt_got.offset = (bfd_vma) -1;
h->plt.offset = (bfd_vma) -1; h->plt.offset = (bfd_vma) -1;
h->needs_plt = 0; h->needs_plt = 0;
} }