]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld-elf/shared libpr23161c and pr23161c tests
authorAlan Modra <amodra@gmail.com>
Thu, 31 Jul 2025 12:10:12 +0000 (21:40 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 1 Aug 2025 01:16:26 +0000 (10:46 +0930)
If I understand these tests correctly it is to ensure that _end,
_edata and __bss_start are not made dynamic.  The dynamic reloc tests
are not really necessary.  (We dropped them from pr23161a and pr23161b
tests a while ago without removing the -r from readelf invocation.)
Dropping the reloc tests allows them to run for more targets.

* testsuite/ld-elf/pr23161c.rd: Rewrite.
* testsuite/ld-elf/pr23161d.rd: Delete.
* testsuite/ld-elf/shared.exp (pr23161a, pr23161b): Remove -r
from readelf check.
(libpr23161c.so, pr23161c): Likewise, and check expected readelf
output using the new pr23161c.rd.

ld/testsuite/ld-elf/pr23161c.rd
ld/testsuite/ld-elf/pr23161d.rd [deleted file]
ld/testsuite/ld-elf/shared.exp

index be99655e7aba2c6b92d9ed65780617eaac1a3414..9b19b366aa82ad8438c37b8cbb59e04a9c4a5330 100644 (file)
@@ -1,6 +1,3 @@
-There are no relocations in this file.
-
-Symbol table '\.dynsym' contains [0-9]+ entries:
- +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +
- +1: +[a-f0-9]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +foo
+#failif
+#...
+.* _?_(end|edata|_bss_start)
diff --git a/ld/testsuite/ld-elf/pr23161d.rd b/ld/testsuite/ld-elf/pr23161d.rd
deleted file mode 100644 (file)
index e7756b3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Relocation section '\.rel(a|)\.plt' at offset 0x[0-9a-f]+ contains 1 entry:
- +Offset +Info +Type +Sym.* Value +Sym.* Name( \+ Addend|)
-[a-f0-9]+ +[0-9a-f]+ +R_.*_JUMP_SLOT +[a-f0-9]+ +foo( \+ [a-f0-9]+|)
-
-Symbol table '\.dynsym' contains [0-9]+ entries:
- +Num: +Value +Size Type +Bind +Vis +Ndx Name
- +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +
- +[0-9]+: +[a-f0-9]+ +0 +FUNC +GLOBAL +DEFAULT +UND +foo
index 84100a7e6d97059bfe55e9a1544b3ff80ce52306..ee881c2d61987ef7db7a0dd83e9b532deece1a76 100644 (file)
@@ -1764,7 +1764,7 @@ if { ([istarget "*-*-linux*"]
            "" \
            $AFLAGS_PIE \
            { pr23161b.c } \
-           {{readelf {--dyn-syms -rW} pr23161b.rd}} \
+           {{readelf {--dyn-syms -W} pr23161b.rd}} \
            "pr23161a" \
            "-fPIC -O0 $NOSANITIZE_CFLAGS" \
        ] \
@@ -1784,23 +1784,17 @@ if { ([istarget "*-*-linux*"]
            "" \
            $AFLAGS_PIE \
            { pr23161b.c } \
-           {{readelf {--dyn-syms -rW} pr23161b.rd}} \
+           {{readelf {--dyn-syms -W} pr23161b.rd}} \
            "pr23161b" \
            "-fPIC -O0 $NOSANITIZE_CFLAGS" \
        ] \
-    ]
-}
-
-if { [istarget "i?86-*-*"]
-     || [istarget "x86_64-*-*"] } {
-    run_ld_link_tests [list \
        [list \
            "Build libpr23161c.so" \
            "-shared" \
            "" \
            "$AFLAGS_PIC" \
            { pr23161c.c } \
-           {{readelf {--dyn-syms -rW} pr23161c.rd}} \
+           {{readelf {--dyn-syms -W} pr23161c.rd}} \
            "libpr23161c.so" \
            "-fPIC -O2 $NOSANITIZE_CFLAGS" \
        ] \
@@ -1810,7 +1804,7 @@ if { [istarget "i?86-*-*"]
            "" \
            $AFLAGS_PIE \
            { pr23161b.c } \
-           {{readelf {--dyn-syms -rW} pr23161d.rd}} \
+           {{readelf {--dyn-syms -W} pr23161c.rd}} \
            "pr23161c" \
            "-fPIC -O0 $NOSANITIZE_CFLAGS" \
        ] \