From: Alan Modra <amodra@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] PR22263 ld test
Date: Fri, 26 May 2023 03:12:32 +0000 (GMT) [thread overview]
Message-ID: <20230526031232.AA1A93857712@sourceware.org> (raw)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9dc7ab5c01347b303c578e0a9221248dbe227b59
commit 9dc7ab5c01347b303c578e0a9221248dbe227b59
Author: Alan Modra <amodra@gmail.com>
Date: Fri May 26 11:51:57 2023 +0930
PR22263 ld test
A number of targets that I test regularly fail the "Build pr22263-1"
test for various reasons.
arm-linux-gnueabi: "undefined reference to `__aeabi_read_tp'"
ia64-linux-gnu: "Explicit stops are ignored in auto mode"
m68k-linux-gnu: "undefined reference to `__m68k_read_tp'"
microblaze-linux-gnu: "undefined reference to `__tls_get_addr'"
nios2-linux-gnu, s390-linux-gnu and sh4-linux-gnu have a tprel reloc in .got
riscv64-linux-gnu has a dynamic relocation in text
So only riscv really fails the pr. The rest fail due to test issues
or lack of a linker optimisation. Lack of an optimisation isn't
really a fail, but it's worth keeping the test to ensure those
optimisations don't regress. The xfail targets may not be an
exhaustive list. This just tidies test results for those for which I
have cross compilers installed.
PR 22263
* testsuite/ld-elf/tls.exp: Split pr22263 test into two parts,
one to check for -z text errors, the other to check tprel
linker optimisation. Supply needed symbols and assembler flags.
xfail the linker optimisation on targets known to fail.
Diff:
---
ld/testsuite/ld-elf/tls.exp | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/ld/testsuite/ld-elf/tls.exp b/ld/testsuite/ld-elf/tls.exp
index 305eb5f68cd..31435128b2b 100644
--- a/ld/testsuite/ld-elf/tls.exp
+++ b/ld/testsuite/ld-elf/tls.exp
@@ -37,17 +37,43 @@ if { ![check_compiler_available] } {
set AFLAGS_PIC ""
if [istarget "sparc*-*-*"] {
append AFLAGS_PIC " -K PIC -Av9"
+} elseif [istarget ia64-*-*] {
+ append AFLAGS_PIC " -x"
+}
+
+set ldflags "-pie -e _start -z text"
+if [istarget arm*-*-*] {
+ append ldflags " --defsym __aeabi_read_tp=0"
+} elseif [istarget m68*-*-*] {
+ append ldflags " --defsym __m68k_read_tp=0"
+} elseif [istarget microblaze-*-*] {
+ append ldflags " --defsym __tls_get_addr=0"
}
run_ld_link_tests [list \
[list \
- "Build pr22263-1" \
- "-pie -e _start -z text" \
+ "pr22263-1 -z text" \
+ $ldflags \
"" \
"$AFLAGS_PIC" \
{ pr22263-1a.c pr22263-1b.c } \
- {{readelf -r pr22263-1.rd}} \
+ {} \
"pr22263-1" \
"-fPIE -O2 $NOSANITIZE_CFLAGS" \
] \
]
+
+if [file exists tmpdir/pr22263-1] {
+ run_ld_link_tests [list \
+ [list \
+ "pr22263-1 tprel optimisation" \
+ $ldflags \
+ "tmpdir/pr22263-1a.o tmpdir/pr22263-1b.o" \
+ "" \
+ {} \
+ {{readelf -r pr22263-1.rd}} \
+ "pr22263-1" \
+ "" \
+ ] \
+ ] ia64-*-* m68*-*-* nios2-*-* s390-*-* sh*-*-*
+}
reply other threads:[~2023-05-26 3:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230526031232.AA1A93857712@sourceware.org \
--to=amodra@sourceware.org \
--cc=bfd-cvs@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).