Browse Source
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.gdb-8.1-branch
5 changed files with 35 additions and 3 deletions
@ -0,0 +1,14 @@ |
|||
#source: pie3.s |
|||
#as: --64 |
|||
#ld: -pie -melf_x86_64 |
|||
#objdump: -dw |
|||
#target: x86_64-*-nacl* |
|||
|
|||
.*: +file format .* |
|||
|
|||
|
|||
Disassembly of section .text: |
|||
|
|||
0+ <_start>: |
|||
+0: 48 8d 05 f9 ff ff ff lea -0x7\(%rip\),%rax # 0 <_start> |
|||
#pass |
|||
@ -0,0 +1,13 @@ |
|||
#as: --64 |
|||
#ld: -pie -melf_x86_64 |
|||
#objdump: -dw |
|||
#notarget: x86_64-*-nacl* |
|||
|
|||
.*: +file format .* |
|||
|
|||
|
|||
Disassembly of section .text: |
|||
|
|||
0+191 <_start>: |
|||
+191: 48 8d 05 68 fe ff ff lea -0x198\(%rip\),%rax # 0 <_start-0x191> |
|||
#pass |
|||
@ -0,0 +1,5 @@ |
|||
.text |
|||
.global _start |
|||
.weak foo |
|||
_start: |
|||
leaq foo(%rip), %rax |
|||
Loading…
Reference in new issue