diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-08-24 06:34:19 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-08-24 06:34:38 -0700 |
commit | 7073b5b9edc9e06974bd733b7e4b3845d6d6f690 (patch) | |
tree | e732f58dcdb8352c0fd8f288e529993ece2fd312 /bfd/ChangeLog | |
parent | 5b5f4e6f8cd250e07ec98278f7223e57b3d3bb0c (diff) | |
download | gdb-7073b5b9edc9e06974bd733b7e4b3845d6d6f690.zip gdb-7073b5b9edc9e06974bd733b7e4b3845d6d6f690.tar.gz gdb-7073b5b9edc9e06974bd733b7e4b3845d6d6f690.tar.bz2 |
x86-64: Check relocations with -z nocopyreloc
On x86-64, when -z nocopyreloc is used to build executable, relocations
may overflow at run-time or may not be resolved without PIC. This patch
checks these conditions and issues an error with suggestion for -fPIC.
bfd/
PR ld/22001
* elf64-x86-64.c (elf_x86_64_relocate_section): Check for
R_X86_64_PC32 relocation run-time overflow and unresolvable
R_X86_64_32S relocation with -z nocopyreloc.
ld/
PR ld/22001
* testsuite/ld-i386/i386.exp: Run -z nocopyreloc tests.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* ld/testsuite/ld-i386/pr22001-1a.c: New file.
* ld/testsuite/ld-i386/pr22001-1b.c: Likewise.
* ld/testsuite/ld-i386/pr22001-1c.S: Likewise.
* ld/testsuite/ld-x86-64/pr22001-1a.c: Likewise.
* ld/testsuite/ld-x86-64/pr22001-1a.err: Likewise.
* ld/testsuite/ld-x86-64/pr22001-1b.c: Likewise.
* ld/testsuite/ld-x86-64/pr22001-1b.err: Likewise.
* ld/testsuite/ld-x86-64/pr22001-1c.c: Likewise.
Diffstat (limited to 'bfd/ChangeLog')
-rw-r--r-- | bfd/ChangeLog | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a45b896..bb38920 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,12 @@ 2017-08-24 H.J. Lu <hongjiu.lu@intel.com> + PR ld/22001 + * elf64-x86-64.c (elf_x86_64_relocate_section): Check for + R_X86_64_PC32 relocation run-time overflow and unresolvable + R_X86_64_32S relocation with -z nocopyreloc. + +2017-08-24 H.J. Lu <hongjiu.lu@intel.com> + * elf32-i386.c (elf_i386_check_relocs): Revert the last change. Undefined symbols may not have a type. * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. |