]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld: Add PR ld/32067 tests
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 10 Aug 2024 14:23:53 +0000 (07:23 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 13 Aug 2024 00:57:30 +0000 (17:57 -0700)
Add PR ld/32067 tests with the compiler driver since the -plugin option
is needed to trigger this --oformat binary bug.

PR ld/32067
* testsuite/ld-i386/i386.exp: Run PR ld/32067 test.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/start.s: Add .note.GNU-stack section.
* testsuite/ld-x86-64/pr32067.s: New file.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 602f5cf7e3a82229d75998a5f6eb13753f828bb3)

ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-i386/start.s
ld/testsuite/ld-x86-64/pr32067.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp

index ad6ad2e725e3abe32e541ec98a9c8bd979b003f3..8dafb6261fbd8e9d62f03f52ae7ae400855bbdde 100644 (file)
@@ -1323,6 +1323,14 @@ if { [isnative]
            {{error_output "pr21997-1.err"}} \
            "pr21997-1" \
        ] \
+       [list \
+           "Build pr32067" \
+           "-Wl,--oformat,binary -nostdlib -nostartfiles" \
+           "" \
+           { start.s ../ld-x86-64/pr32067.s } \
+           {} \
+           "pr32067" \
+       ] \
     ]
 
     # The musl C library does not support TEXTRELs.
index 80301c6a7e4dee67c1157919a64f7995d126137f..4262a3380fae60e623755a52c31cf80413f012bd 100644 (file)
@@ -1,3 +1,4 @@
        .globl _start
 _start:
        jmp foo
+       .section        .note.GNU-stack
diff --git a/ld/testsuite/ld-x86-64/pr32067.s b/ld/testsuite/ld-x86-64/pr32067.s
new file mode 100644 (file)
index 0000000..40878a9
--- /dev/null
@@ -0,0 +1,5 @@
+       .text
+       .globl foo
+foo:
+       ret
+       .section        .note.GNU-stack
index 742823e64580e73bc737a6d09db6a3c78d60d093..0697e67faf3964642f2dc8f02ddc87626528c0d0 100644 (file)
@@ -1405,6 +1405,14 @@ if { [isnative] && [check_compiler_available] } {
            {{readelf -n indirect-extern-access.rd}}  \
            "libprotected-data-2b.so" \
        ] \
+       [list \
+           "Build pr32067" \
+           "-Wl,--oformat,binary -nostdlib -nostartfiles" \
+           "" \
+           { start.s pr32067.s } \
+           {} \
+           "pr32067" \
+       ] \
     ]
 
     if  {[istarget "x86_64-*-linux*-gnux32"]} {