aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-05-13 10:59:32 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-05-13 11:07:02 -0700
commit2168b2688ae343a61c467450068503295a5e3deb (patch)
tree5ea6df0bc1d59129657f33172000d30e91cad252 /bfd
parentd2edc834f769d9d05756c66f01c3bf05349a7fb7 (diff)
downloadgdb-2168b2688ae343a61c467450068503295a5e3deb.zip
gdb-2168b2688ae343a61c467450068503295a5e3deb.tar.gz
gdb-2168b2688ae343a61c467450068503295a5e3deb.tar.bz2
Don't convert GOTPCREL relocation against large section
bfd/ PR ld/20093 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Don't convert GOTPCREL relocation against large section. ld/ PR ld/20093 * testsuite/ld-x86-64/pr20093-1.d: New file. * testsuite/ld-x86-64/pr20093-1.s: Likewise. * testsuite/ld-x86-64/pr20093-2.d: Likewise. * testsuite/ld-x86-64/pr20093-2.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr20093-1 and pr20093-2.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elf64-x86-64.c5
2 files changed, 12 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f13c248..9583ebd 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,8 +1,14 @@
+2016-05-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/20093
+ * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Don't convert
+ GOTPCREL relocation against large section.
+
2016-05-13 Alan Modra <amodra@gmail.com>
* elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_sections): Use
linker dynamic sections in calculating size and address of
- * dynamic tags rather than using output sections. Remove asserts.
+ dynamic tags rather than using output sections. Remove asserts.
* elf32-arm.c (elf32_arm_finish_dynamic_sections): Likewise.
* elf32-cr16.c (_bfd_cr16_elf_finish_dynamic_sections): Likewise.
* elf32-cris.c (elf_cris_finish_dynamic_sections): Likewise.
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 0bcd59d..9fc884e 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1806,6 +1806,11 @@ elf_x86_64_convert_load_reloc (bfd *abfd, asection *sec,
return TRUE;
}
+ /* Don't convert GOTPCREL relocation against large section. */
+ if (elf_section_data (tsec) != NULL
+ && (elf_section_flags (tsec) & SHF_X86_64_LARGE) != 0)
+ return TRUE;
+
/* We can only estimate relocation overflow for R_X86_64_PC32. */
if (!to_reloc_pc32)
goto convert;