aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2025-07-31 21:40:12 +0930
committerAlan Modra <amodra@gmail.com>2025-08-01 10:46:26 +0930
commitce6a13a42fb3191debdc1d01c13e979beb6714aa (patch)
tree2d14c207797b0045b4c4ec91497bc4193cdeb3ee
parent32b42067970502c02f145b95fd43dd03c805aaea (diff)
downloadbinutils-ce6a13a42fb3191debdc1d01c13e979beb6714aa.zip
binutils-ce6a13a42fb3191debdc1d01c13e979beb6714aa.tar.gz
binutils-ce6a13a42fb3191debdc1d01c13e979beb6714aa.tar.bz2
ld-elf/shared libpr23161c and pr23161c tests
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.
-rw-r--r--ld/testsuite/ld-elf/pr23161c.rd9
-rw-r--r--ld/testsuite/ld-elf/pr23161d.rd8
-rw-r--r--ld/testsuite/ld-elf/shared.exp14
3 files changed, 7 insertions, 24 deletions
diff --git a/ld/testsuite/ld-elf/pr23161c.rd b/ld/testsuite/ld-elf/pr23161c.rd
index be99655..9b19b36 100644
--- a/ld/testsuite/ld-elf/pr23161c.rd
+++ b/ld/testsuite/ld-elf/pr23161c.rd
@@ -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
index e7756b3..0000000
--- a/ld/testsuite/ld-elf/pr23161d.rd
+++ /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
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index 84100a7..ee881c2 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -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" \
] \