diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-08-23 13:40:49 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-08-23 13:43:45 -0700 |
commit | aab921adcb656e4eefcc7d0f14241f3d7504400e (patch) | |
tree | 96f0d19086c092a9126bf5627164c2c23d6141f1 /ld | |
parent | b1bb697ea1259c0977c38f1ec5f2239cbe669869 (diff) | |
download | gdb-aab921adcb656e4eefcc7d0f14241f3d7504400e.zip gdb-aab921adcb656e4eefcc7d0f14241f3d7504400e.tar.gz gdb-aab921adcb656e4eefcc7d0f14241f3d7504400e.tar.bz2 |
x86-64: Properly report output type when PIC is needed
-fPIC may be needed to compile PIE or PDE objects, not just shared
object.
bfd/
* elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
bfd_link_info. Report shared, PIE or PDE object based on
bfd_link_info.
(elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
(elf_x86_64_relocate_section): Likewise.
ld/
* testsuite/ld-x86-64/pie2.d: Updated.
* testsuite/ld-x86-64/pr19719.d: Likewise.
* testsuite/ld-x86-64/pr19807-2a.d: Likewise.
* testsuite/ld-x86-64/pr19969.d: Likewise.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pie2.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr19719.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr19807-2a.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr19969.d | 2 |
5 files changed, 11 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index c499de7..bd73279 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,12 @@ 2017-08-23 H.J. Lu <hongjiu.lu@intel.com> + * testsuite/ld-x86-64/pie2.d: Updated. + * testsuite/ld-x86-64/pr19719.d: Likewise. + * testsuite/ld-x86-64/pr19807-2a.d: Likewise. + * testsuite/ld-x86-64/pr19969.d: Likewise. + +2017-08-23 H.J. Lu <hongjiu.lu@intel.com> + * testsuite/ld-i386/i386.exp: Run protected7. * testsuite/ld-i386/protected7.d: New file. * testsuite/ld-i386/protected7.s: Likewise. diff --git a/ld/testsuite/ld-x86-64/pie2.d b/ld/testsuite/ld-x86-64/pie2.d index ef9f58a..9532141 100644 --- a/ld/testsuite/ld-x86-64/pie2.d +++ b/ld/testsuite/ld-x86-64/pie2.d @@ -1,3 +1,3 @@ #as: --64 #ld: -pie -melf_x86_64 -#error: .*relocation R_X86_64_32 against symbol `foo' can not be used when making a shared object; recompile with -fPIC +#error: .*relocation R_X86_64_32 against symbol `foo' can not be used when making a PIE object; recompile with -fPIC diff --git a/ld/testsuite/ld-x86-64/pr19719.d b/ld/testsuite/ld-x86-64/pr19719.d index b2daf0e..03cfc15 100644 --- a/ld/testsuite/ld-x86-64/pr19719.d +++ b/ld/testsuite/ld-x86-64/pr19719.d @@ -1,3 +1,3 @@ #as: --64 #ld: -pie -melf_x86_64 -#error: .*relocation R_X86_64_32 against undefined symbol `foo' can not be used when making a shared object; recompile with -fPIC +#error: .*relocation R_X86_64_32 against undefined symbol `foo' can not be used when making a PIE object; recompile with -fPIC diff --git a/ld/testsuite/ld-x86-64/pr19807-2a.d b/ld/testsuite/ld-x86-64/pr19807-2a.d index 1357d72..c99852a 100644 --- a/ld/testsuite/ld-x86-64/pr19807-2a.d +++ b/ld/testsuite/ld-x86-64/pr19807-2a.d @@ -1,4 +1,4 @@ #source: pr19807-2.s #as: --64 #ld: -pie -melf_x86_64 -#error: .*relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC +#error: .*relocation R_X86_64_32 against `.data' can not be used when making a PIE object; recompile with -fPIC diff --git a/ld/testsuite/ld-x86-64/pr19969.d b/ld/testsuite/ld-x86-64/pr19969.d index c56af2f..1aea67c 100644 --- a/ld/testsuite/ld-x86-64/pr19969.d +++ b/ld/testsuite/ld-x86-64/pr19969.d @@ -1,4 +1,4 @@ #source: pr19969b.S #as: --64 #ld: -melf_x86_64 tmpdir/pr19969.so -#error: .*relocation R_X86_64_32 against symbol `foo' can not be used when making a shared object; recompile with -fPIC +#error: .*relocation R_X86_64_32 against symbol `foo' can not be used when making a PDE object; recompile with -fPIC |