diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-07-17 12:17:59 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-07-17 12:17:59 -0700 |
commit | c5bb8910e80c6cd80c63541f86471c18375c8198 (patch) | |
tree | b5a5700669844bb7176eb26624c094b070021a68 /bfd/elf64-x86-64.c | |
parent | 1d550c828c00978860de9ba35b9ab5b182b968bc (diff) | |
download | gdb-c5bb8910e80c6cd80c63541f86471c18375c8198.zip gdb-c5bb8910e80c6cd80c63541f86471c18375c8198.tar.gz gdb-c5bb8910e80c6cd80c63541f86471c18375c8198.tar.bz2 |
x86-64: Limit PIC check to shared library build
When building an executable, undefined symbols are error and undefined
weak symbols are resolved to zero. We only need to check PIC for
building a shared library.
bfd/
PR ld/21782
* elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
to shared library.
ld/
PR ld/21782
* testsuite/ld-x86-64/pie3-nacl.d: New file.
* testsuite/ld-x86-64/pie3.d: Likewise.
* testsuite/ld-x86-64/pie3.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pie3 and pie3-nacl.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r-- | bfd/elf64-x86-64.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 79bc9fb..3658df4 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -4968,9 +4968,7 @@ do_ifunc_pointer: && ((bfd_link_executable (info) && h->root.type == bfd_link_hash_undefweak && !resolved_to_zero) - || (bfd_link_pic (info) - && !(bfd_link_pie (info) - && h->root.type == bfd_link_hash_undefined)))) + || bfd_link_dll (info))) { bfd_boolean fail = FALSE; bfd_boolean branch |