Browse Source
When building executable, undefined symbol is a fatal error. We don't complain about -fPIC if the symbol is undefined. bfd/ PR ld/17847 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't complain about -fPIC if the symbol is undefined when building executable. ld/testsuite/ PR ld/17847 * ld-x86-64/pie1.d: New file. * ld-x86-64/pie1.s: Likwise. * ld-x86-64/x86-64.exp: Run pie1.gdb-7.10-branch
6 changed files with 37 additions and 3 deletions
@ -0,0 +1,9 @@ |
|||
#name: PIE with undefined symbol |
|||
#as: --64 |
|||
#ld: -pie -melf_x86_64 --noinhibit-exec |
|||
#readelf: -s --wide |
|||
#warning: \A[^\n]*\.o[^\n]*In function `_start':\n[^\n]*: undefined reference to `foo'\Z |
|||
|
|||
#... |
|||
+[0-9]+: +[0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND foo |
|||
#pass |
|||
@ -0,0 +1,4 @@ |
|||
.text |
|||
.global _start |
|||
_start: |
|||
movl foo(%rip), %eax |
|||
Loading…
Reference in new issue