From: changjiachen <changjiachen@stu.xupt.edu.cn>
To: binutils@sourceware.org
Cc: xuchenghua@loongson.cn, chenglulu@loongson.cn,
liuzhensong@loongson.cn, xry111@xry111.site, i.swmail@xen0n.name,
maskray@google.com, cailulu@loongson.cn, luweining@loongson.cn,
wanglei@loongson.cn, hejinyang@loongson.cn, Lazy_Linux@126.com,
mengqinggang@loongson.cn,
changjiachen <changjiachen@stu.xupt.edu.cn>
Subject: [PATCH v1] LoongArch: ld: Adjusted some code order in relax.exp.
Date: Fri, 5 Jan 2024 17:17:44 +0800 [thread overview]
Message-ID: <20240105091744.125622-1-changjiachen@stu.xupt.edu.cn> (raw)
ld/testsuite/ChangeLog:
* ld/testsuite/ld-loongarch-elf/relax.exp: Modify test.
---
ld/testsuite/ld-loongarch-elf/relax.exp | 290 ++++++++++++------------
1 file changed, 145 insertions(+), 145 deletions(-)
diff --git a/ld/testsuite/ld-loongarch-elf/relax.exp b/ld/testsuite/ld-loongarch-elf/relax.exp
index b697d01563c..5da297533ac 100644
--- a/ld/testsuite/ld-loongarch-elf/relax.exp
+++ b/ld/testsuite/ld-loongarch-elf/relax.exp
@@ -33,90 +33,8 @@ if [istarget loongarch64-*-*] {
"relax" \
] \
]
- set tls_relax_builds [list \
- [list \
- "tls_relax_builds" \
- "" \
- "" \
- {relax-tls-le.s} \
- {} \
- "relax-tls-le" \
- ] \
- ]
- set tls_no_relax_builds [list \
- [list \
- "tls_no_relax_builds" \
- "-Wl,--no-relax" \
- "" \
- {relax-tls-le.s} \
- {} \
- "no-relax-tls-le" \
- ] \
- ]
-
- set relax_bound_check [list \
- [list \
- "relax_bound_check" \
- "" \
- "" \
- {relax-bound-check-tls-le.s} \
- {} \
- "relax-bound-check-tls-le" \
- ] \
- ]
- set no_relax_bound_check [list \
- [list \
- "no_relax_bound_check" \
- "-Wl,--no-relax" \
- "" \
- {relax-bound-check-tls-le.s} \
- {} \
- "no-relax-bound-check-tls-le" \
- ] \
- ]
-
- set old_tls_le [list \
- [list \
- "old_tls_le" \
- "" \
- "" \
- {old-tls-le.s} \
- {} \
- "old-tls-le" \
- ] \
- ]
-
- set relax_compatible [list \
- [list \
- "relax_compatible" \
- "" \
- "" \
- {tls-relax-compatible-check-new.s tls-relax-compatible-check-old.s} \
- {} \
- "realx-compatible" \
- ] \
- ]
-
- set no_relax_compatible [list \
- [list \
- "no_relax_compatible" \
- "-Wl,--no-relax" \
- "" \
- {tls-relax-compatible-check-new.s tls-relax-compatible-check-old.s} \
- {} \
- "no-realx-compatible" \
- ] \
- ]
-
run_cc_link_tests $pre_builds
- run_cc_link_tests $tls_relax_builds
- run_cc_link_tests $tls_no_relax_builds
- run_cc_link_tests $relax_bound_check
- run_cc_link_tests $no_relax_bound_check
- run_cc_link_tests $old_tls_le
- run_cc_link_tests $relax_compatible
- run_cc_link_tests $no_relax_compatible
if [file exist "tmpdir/relax"] {
set objdump_output [run_host_cmd "objdump" "-d tmpdir/relax"]
@@ -171,98 +89,180 @@ if [istarget loongarch64-*-*] {
}
}
- # If symbol in data segment, offset need to sub segment align to prevent
- # overflow.
run_ld_link_tests \
[list \
[list \
- "loongarch relax segment alignment min" \
- "-e0 -Ttext 0x120004000 -pie -z relro" "" \
+ "loongarch tls le relax .exe build" \
+ "" "" \
"" \
- {relax-segment-min.s} \
+ {relax-tls-le.s} \
{} \
- "relax-segment-min" \
+ "relax-tls-le" \
] \
]
+ if [file exist "tmpdir/relax-tls-le"] {
+ set objdump_output1 [run_host_cmd "objdump" "-d tmpdir/relax-tls-le"]
+ if { [ regexp ".addi.*st.*" $objdump_output1] } {
+ pass "loongarch relax success"
+ } {
+ fail "loongarch relax fail"
+ }
+ }
+
run_ld_link_tests \
[list \
[list \
- "loongarch relax segment alignment max" \
- "-e0 -Ttext 0x120004000 -pie -z relro" "" \
+ "loongarch tls le no relax .exe build" \
+ "--no-relax" "" \
"" \
- {relax-segment-max.s} \
+ {relax-tls-le.s} \
{} \
- "relax-segment-max" \
+ "no-relax-tls-le" \
] \
]
- if [file exist "tmpdir/relax-tls-le"] {
- set objdump_output1 [run_host_cmd "objdump" "-d tmpdir/relax-tls-le"]
- if { [ regexp ".addi.*st.*" $objdump_output1] } {
- pass "loongarch relax success"
- } {
- fail "loongarch relax fail"
- }
- }
- if [file exist "tmpdir/no-relax-tls-le"] {
- set objdump_output2 [run_host_cmd "objdump" "-d tmpdir/no-relax-tls-le"]
- if { [ regexp ".*lu12i.*add.*addi.*st.*" $objdump_output2] } {
- pass "loongarch no-relax success"
- } {
- fail "loongarch no-relax fail"
+ if [file exist "tmpdir/no-relax-tls-le"] {
+ set objdump_output2 [run_host_cmd "objdump" "-d tmpdir/no-relax-tls-le"]
+ if { [ regexp ".*lu12i.*add.*addi.*st.*" $objdump_output2] } {
+ pass "loongarch no-relax success"
+ } {
+ fail "loongarch no-relax fail"
+ }
}
- }
- if [file exist "tmpdir/old-tls-le"] {
- set objdump_output3 [run_host_cmd "objdump" "-d tmpdir/old-tls-le"]
- if { [ regexp ".*lu12i.*ori.*add.*addi.*stptr.*" $objdump_output3] } {
- pass "loongarch old tls le success"
- } {
- fail "loongarch old tls le fail"
+ run_ld_link_tests \
+ [list \
+ [list \
+ "loongarch old tls le .exe build" \
+ "" "" \
+ "" \
+ {old-tls-le.s} \
+ {} \
+ "old-tls-le" \
+ ] \
+ ]
+
+ if [file exist "tmpdir/old-tls-le"] {
+ set objdump_output3 [run_host_cmd "objdump" "-d tmpdir/old-tls-le"]
+ if { [ regexp ".*lu12i.*ori.*add.*addi.*stptr.*" $objdump_output3] } {
+ pass "loongarch old tls le success"
+ } {
+ fail "loongarch old tls le fail"
+ }
}
- }
+ run_ld_link_tests \
+ [list \
+ [list \
+ "loongarch tls le realx compatible .exe build" \
+ "" "" \
+ "" \
+ {tls-relax-compatible-check-new.s tls-relax-compatible-check-old.s} \
+ {} \
+ "realx-compatible" \
+ ] \
+ ]
- if [file exist "tmpdir/realx-compatible"] {
- set objdump_output4 [run_host_cmd "objdump" "-d tmpdir/realx-compatible"]
- if { [ regexp ".addi.*st.*" $objdump_output4] && \
- [ regexp ".*lu12i.*ori.*add.*addi.*stptr.*" $objdump_output4] } {
- pass "loongarch tls le relax compatible check success"
- } {
- fail "loongarch tls le relax compatible check fail"
+ if [file exist "tmpdir/realx-compatible"] {
+ set objdump_output4 [run_host_cmd "objdump" "-d tmpdir/realx-compatible"]
+ if { [ regexp ".addi.*st.*" $objdump_output4] && \
+ [ regexp ".*lu12i.*ori.*add.*addi.*stptr.*" $objdump_output4] } {
+ pass "loongarch tls le relax compatible check success"
+ } {
+ fail "loongarch tls le relax compatible check fail"
+ }
}
- }
- if [file exist "tmpdir/no-realx-compatible"] {
- set objdump_output4 [run_host_cmd "objdump" "-d tmpdir/realx-compatible"]
- if { [ regexp ".*lu12i.*add.*addi.*st.*" $objdump_output4] && \
- [ regexp ".*lu12i.*ori.*add.*addi.*stptr.*" $objdump_output4] } {
- pass "loongarch tls le no-relax compatible check success"
- } {
- fail "loongarch tls le no-relax compatible check fail"
+ run_ld_link_tests \
+ [list \
+ [list \
+ "loongarch tls le no realx compatible .exe build" \
+ "--no-relax" "" \
+ "" \
+ {tls-relax-compatible-check-new.s tls-relax-compatible-check-old.s} \
+ {} \
+ "no-realx-compatible" \
+ ] \
+ ]
+ if [file exist "tmpdir/no-realx-compatible"] {
+ set objdump_output4 [run_host_cmd "objdump" "-d tmpdir/no-realx-compatible"]
+ if { [ regexp ".*lu12i.*add.*addi.*st.*" $objdump_output4] && \
+ [ regexp ".*lu12i.*ori.*add.*addi.*stptr.*" $objdump_output4] } {
+ pass "loongarch tls le no-relax compatible check success"
+ } {
+ fail "loongarch tls le no-relax compatible check fail"
+ }
}
- }
+ run_ld_link_tests \
+ [list \
+ [list \
+ "loongarch tls le realx bound-check .exe build" \
+ "" "" \
+ "" \
+ {relax-bound-check-tls-le.s} \
+ {} \
+ "relax-bound-check-tls-le" \
+ ] \
+ ]
- if [file exist "tmpdir/relax-bound-check-tls-le"] {
- set objdump_output5 [run_host_cmd "objdump" "-d tmpdir/relax-bound-check-tls-le"]
- if { [ regexp ".*lu12i.*add.*addi.*st.*" $objdump_output5] && \
- [ regexp ".addi.*st.*" $objdump_output5] } {
- pass "loongarch no-relax success"
- } {
- fail "loongarch no-relax fail"
+ if [file exist "tmpdir/relax-bound-check-tls-le"] {
+ set objdump_output5 [run_host_cmd "objdump" "-d tmpdir/relax-bound-check-tls-le"]
+ if { [ regexp ".*lu12i.*add.*addi.*st.*" $objdump_output5] && \
+ [ regexp ".addi.*st.*" $objdump_output5] } {
+ pass "loongarch no-relax success"
+ } {
+ fail "loongarch no-relax fail"
+ }
}
- }
- if [file exist "tmpdir/no-relax-bound-check-tls-le"] {
- set objdump_output5 [run_host_cmd "objdump" "-d tmpdir/no-relax-bound-check-tls-le"]
- if { [ regexp ".*addi.*st.*" $objdump_output5] } {
- pass "loongarch no-relax success"
- } {
- fail "loongarch no-relax fail"
+ run_ld_link_tests \
+ [list \
+ [list \
+ "loongarch tls le no realx bound-check .exe build" \
+ "--no-relax" "" \
+ "" \
+ {relax-bound-check-tls-le.s} \
+ {} \
+ "no-relax-bound-check-tls-le" \
+ ] \
+ ]
+
+ if [file exist "tmpdir/no-relax-bound-check-tls-le"] {
+ set objdump_output5 [run_host_cmd "objdump" "-d tmpdir/no-relax-bound-check-tls-le"]
+ if { [ regexp ".*addi.*st.*" $objdump_output5] } {
+ pass "loongarch no-relax success"
+ } {
+ fail "loongarch no-relax fail"
+ }
}
- }
+
+ # If symbol in data segment, offset need to sub segment align to prevent
+ # overflow.
+ run_ld_link_tests \
+ [list \
+ [list \
+ "loongarch relax segment alignment min" \
+ "-e0 -Ttext 0x120004000 -pie -z relro" "" \
+ "" \
+ {relax-segment-min.s} \
+ {} \
+ "relax-segment-min" \
+ ] \
+ ]
+
+ run_ld_link_tests \
+ [list \
+ [list \
+ "loongarch relax segment alignment max" \
+ "-e0 -Ttext 0x120004000 -pie -z relro" "" \
+ "" \
+ {relax-segment-max.s} \
+ {} \
+ "relax-segment-max" \
+ ] \
+ ]
}
run_ld_link_tests \
--
2.40.0
reply other threads:[~2024-01-05 9:18 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=20240105091744.125622-1-changjiachen@stu.xupt.edu.cn \
--to=changjiachen@stu.xupt.edu.cn \
--cc=Lazy_Linux@126.com \
--cc=binutils@sourceware.org \
--cc=cailulu@loongson.cn \
--cc=chenglulu@loongson.cn \
--cc=hejinyang@loongson.cn \
--cc=i.swmail@xen0n.name \
--cc=liuzhensong@loongson.cn \
--cc=luweining@loongson.cn \
--cc=maskray@google.com \
--cc=mengqinggang@loongson.cn \
--cc=wanglei@loongson.cn \
--cc=xry111@xry111.site \
--cc=xuchenghua@loongson.cn \
/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).