ld: Fix test failures with --enable-textrel-check=error
Checks
Commit Message
Tested with the following:
* --enable-textrel-check=error
* --enable-warn-execstack=yes
* --enable-warn-rwx-segments=yes
* --enable-default-execstack=no
in preparation for hopefully toggling these in Gentoo Hardened
at least.
This is similar in nature to 0ab7005043ee404dabfd690952efc25c399995ae
and 340640f710e690b37c885166949595cde5f827b2.
This fixes the following test failures:
* FAIL: ld-x86-64/pr18801a
* FAIL: ld-x86-64/pr18801b
* FAIL: ld-x86-64/ifunc-textrel-1a
* FAIL: ld-x86-64/ifunc-textrel-1b
* FAIL: ld-i386/pr18801a
* FAIL: ld-i386/pr18801b
* FAIL: ld-i386/ifunc-textrel-1a
* FAIL: ld-i386/ifunc-textrel-1b
Signed-off-by: Sam James <sam@gentoo.org>
---
ld/testsuite/ld-i386/ifunc-textrel-1a.d | 2 +-
ld/testsuite/ld-i386/ifunc-textrel-1b.d | 2 +-
ld/testsuite/ld-i386/pr18801a.d | 2 +-
ld/testsuite/ld-i386/pr18801b.d | 2 +-
ld/testsuite/ld-x86-64/ifunc-textrel-1a.d | 2 +-
ld/testsuite/ld-x86-64/ifunc-textrel-1b.d | 2 +-
ld/testsuite/ld-x86-64/pr18801a.d | 2 +-
ld/testsuite/ld-x86-64/pr18801b.d | 2 +-
8 files changed, 8 insertions(+), 8 deletions(-)
Comments
Hi Sam,
> Signed-off-by: Sam James <sam@gentoo.org>
> ---
> ld/testsuite/ld-i386/ifunc-textrel-1a.d | 2 +-
> ld/testsuite/ld-i386/ifunc-textrel-1b.d | 2 +-
> ld/testsuite/ld-i386/pr18801a.d | 2 +-
> ld/testsuite/ld-i386/pr18801b.d | 2 +-
> ld/testsuite/ld-x86-64/ifunc-textrel-1a.d | 2 +-
> ld/testsuite/ld-x86-64/ifunc-textrel-1b.d | 2 +-
> ld/testsuite/ld-x86-64/pr18801a.d | 2 +-
> ld/testsuite/ld-x86-64/pr18801b.d | 2 +-
> 8 files changed, 8 insertions(+), 8 deletions(-)
Approved - please apply.
Cheers
Nick
Nick Clifton <nickc@redhat.com> writes:
> Hi Sam,
>
>> Signed-off-by: Sam James <sam@gentoo.org>
>> ---
>> ld/testsuite/ld-i386/ifunc-textrel-1a.d | 2 +-
>> ld/testsuite/ld-i386/ifunc-textrel-1b.d | 2 +-
>> ld/testsuite/ld-i386/pr18801a.d | 2 +-
>> ld/testsuite/ld-i386/pr18801b.d | 2 +-
>> ld/testsuite/ld-x86-64/ifunc-textrel-1a.d | 2 +-
>> ld/testsuite/ld-x86-64/ifunc-textrel-1b.d | 2 +-
>> ld/testsuite/ld-x86-64/pr18801a.d | 2 +-
>> ld/testsuite/ld-x86-64/pr18801b.d | 2 +-
>> 8 files changed, 8 insertions(+), 8 deletions(-)
>
> Approved - please apply.
>
Thanks Nick! I don't have commit access yet for binutils,
although I do for glibc.
Could you push for me in that case?
thanks,
sam
@@ -1,4 +1,4 @@
#source: ../ld-x86-64/ifunc-textrel-1.s
#as: --32
-#ld: -m elf_i386 -pie
+#ld: -m elf_i386 -pie -z notext
#warning: GNU indirect functions with DT_TEXTREL may result in a segfault at runtime; recompile with -fPIE
@@ -1,4 +1,4 @@
#source: ../ld-x86-64/ifunc-textrel-1.s
#as: --32
-#ld: -m elf_i386 -shared
+#ld: -m elf_i386 -shared -z notext
#warning: GNU indirect functions with DT_TEXTREL may result in a segfault at runtime; recompile with -fPIC
@@ -1,4 +1,4 @@
#source: pr18801.s
#as: --32
-#ld: -m elf_i386 -pie
+#ld: -m elf_i386 -pie -z notext
#warning: GNU indirect functions with DT_TEXTREL may result in a segfault at runtime; recompile with -fPIE
@@ -1,4 +1,4 @@
#source: pr18801.s
#as: --32
-#ld: -m elf_i386 -shared
+#ld: -m elf_i386 -shared -z notext
#warning: GNU indirect functions with DT_TEXTREL may result in a segfault at runtime; recompile with -fPIC
@@ -1,4 +1,4 @@
#source: ifunc-textrel-1.s
#as: --64 -defsym __x86_64__=1
-#ld: -m elf_x86_64 -pie
+#ld: -m elf_x86_64 -pie -z notext
#warning: GNU indirect functions with DT_TEXTREL may result in a segfault at runtime; recompile with -fPIE
@@ -1,4 +1,4 @@
#source: ifunc-textrel-1.s
#as: --64 -defsym __x86_64__=1
-#ld: -m elf_x86_64 -shared
+#ld: -m elf_x86_64 -shared -z notext
#warning: GNU indirect functions with DT_TEXTREL may result in a segfault at runtime; recompile with -fPIC
@@ -1,4 +1,4 @@
#source: pr18801.s
#as: --64
-#ld: -melf_x86_64 -pie
+#ld: -melf_x86_64 -pie -z notext
#warning: GNU indirect functions with DT_TEXTREL may result in a segfault at runtime; recompile with -fPIE
@@ -1,4 +1,4 @@
#source: pr18801.s
#as: --64
-#ld: -melf_x86_64 -shared
+#ld: -melf_x86_64 -shared -z notext
#warning: GNU indirect functions with DT_TEXTREL may result in a segfault at runtime; recompile with -fPIC