Browse Source
When PIC is needed, linker should suggest -fPIE, instead of -fPIC, when not building shared object. bfd/ * elf64-x86-64.c (elf_x86_64_need_pic): Suggest -fPIE when not building shared object. * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Likewise. ld/ * testsuite/ld-i386/i386.exp: Run pr18801a and pr18801b instead of pr18801. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-i386/pr18801.d: Removed. * testsuite/ld-x86-64/pr18801.d: Likewise. * testsuite/ld-i386/pr18801a.d: New file. * testsuite/ld-i386/pr18801b.d: Likewise. * testsuite/ld-x86-64/pr18801a.d: Likewise. * testsuite/ld-x86-64/pr18801b.d: Likewise. * testsuite/ld-x86-64/pie2.d: Suggest -fPIE instead of -fPIC. * testsuite/ld-x86-64/pie2.d: Likewise. * testsuite/ld-x86-64/pr19719.d: Likewise. * testsuite/ld-x86-64/pr19807-2a.d: Likewise. * testsuite/ld-x86-64/pr19969.d: Likewise. * testsuite/ld-x86-64/pr21997-1a.err: Likewise. * testsuite/ld-x86-64/pr21997-1b.err: Likewise. * testsuite/ld-x86-64/pr22001-1a.err: Likewise. * testsuite/ld-x86-64/pr22001-1b.err: Likewise. * testsuite/ld-x86-64/pr22791-1.err: Likewise.binutils-2_33-branch
19 changed files with 70 additions and 20 deletions
@ -1,3 +1,4 @@ |
|||
#source: pr18801.s |
|||
#as: --32 |
|||
#ld: -m elf_i386 -pie |
|||
#error: read-only segment has dynamic IFUNC relocations; recompile with -fPIC |
|||
#error: read-only segment has dynamic IFUNC relocations; recompile with -fPIE |
|||
@ -0,0 +1,4 @@ |
|||
#source: pr18801.s |
|||
#as: --32 |
|||
#ld: -m elf_i386 -shared |
|||
#error: read-only segment has dynamic IFUNC relocations; recompile with -fPIC |
|||
@ -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 PIE object; recompile with -fPIC |
|||
#error: .*relocation R_X86_64_32 against symbol `foo' can not be used when making a PIE object; recompile with -fPIE |
|||
|
|||
@ -1,3 +1,4 @@ |
|||
#source: pr18801.s |
|||
#as: --64 |
|||
#ld: -melf_x86_64 -pie |
|||
#error: read-only segment has dynamic IFUNC relocations; recompile with -fPIC |
|||
#error: read-only segment has dynamic IFUNC relocations; recompile with -fPIE |
|||
@ -0,0 +1,4 @@ |
|||
#source: pr18801.s |
|||
#as: --64 |
|||
#ld: -melf_x86_64 -shared |
|||
#error: read-only segment has dynamic IFUNC relocations; recompile with -fPIC |
|||
@ -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 PIE 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 -fPIE |
|||
|
|||
@ -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 PIE object; recompile with -fPIC |
|||
#error: .*relocation R_X86_64_32 against `.data' can not be used when making a PIE object; recompile with -fPIE |
|||
|
|||
@ -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 PDE object; recompile with -fPIC |
|||
#error: .*relocation R_X86_64_32 against symbol `foo' can not be used when making a PDE object; recompile with -fPIE |
|||
|
|||
@ -1,2 +1,2 @@ |
|||
.*relocation R_X86_64_PC32 against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIC |
|||
.*relocation R_X86_64_PC32 against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIE |
|||
#... |
|||
|
|||
@ -1,2 +1,2 @@ |
|||
.*relocation R_X86_64_32S against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIC |
|||
.*relocation R_X86_64_32S against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIE |
|||
#... |
|||
|
|||
@ -1,2 +1,2 @@ |
|||
.*relocation R_X86_64_PC32 against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIC |
|||
.*relocation R_X86_64_PC32 against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIE |
|||
#... |
|||
|
|||
@ -1,2 +1,2 @@ |
|||
.*relocation R_X86_64_32S against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIC |
|||
.*relocation R_X86_64_32S against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIE |
|||
#... |
|||
|
|||
@ -1,2 +1,2 @@ |
|||
.*relocation R_X86_64_PC32 against symbol `foo' can not be used when making a PIE object; recompile with -fPIC |
|||
.*relocation R_X86_64_PC32 against symbol `foo' can not be used when making a PIE object; recompile with -fPIE |
|||
#... |
|||
|
|||
Loading…
Reference in new issue