x86-64: Limit PIC check to shared library build
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 17 Jul 2017 19:17:59 +0000 (12:17 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 17 Jul 2017 19:17:59 +0000 (12:17 -0700)
commitc5bb8910e80c6cd80c63541f86471c18375c8198
treeb5a5700669844bb7176eb26624c094b070021a68
parent1d550c828c00978860de9ba35b9ab5b182b968bc
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.
bfd/elf64-x86-64.c
ld/testsuite/ld-x86-64/pie3-nacl.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pie3.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pie3.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp