public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] LoongArch: gcc: Modify gas uleb128 support test.
@ 2023-09-14 11:21 Lulu Cheng
  2023-09-14 11:45 ` Xi Ruoyao
  0 siblings, 1 reply; 5+ messages in thread
From: Lulu Cheng @ 2023-09-14 11:21 UTC (permalink / raw)
  To: gcc-patches; +Cc: xry111, i, xuchenghua, mengqinggang

From: mengqinggang <mengqinggang@loongson.cn>

Add "ld conftest.o -o conftest" process, then the "objdump -dr" contents
is right. Because gas write zero to objdec file and generate
R_LARCH_ADD_ULEB128/R_LARCH_SUB_ULEB128 reloc pair to calcualte uleb128
format symbol subtraction after ld relaxation.

gcc/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Add "ld conftest.o -o conftest" process.
---
 gcc/configure    | 13 +++++++++++++
 gcc/configure.ac | 13 +++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/gcc/configure b/gcc/configure
index c7b26d1927d..d4763e6fd18 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -24638,6 +24638,19 @@ L2:
   test $ac_status = 0; }; }
     then
 
+case "$target" in
+  loongarch*-*-*)
+    if test "x$gcc_cv_ld" != x; then
+      ac_try='$gcc_cv_ld conftest.o -o conftest -e 0x0 >&5'
+      { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+      (eval $ac_try) 2>&5
+      ac_status=$?
+      $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+      test $ac_status = 0
+      mv conftest conftest.o
+    fi
+esac
+
 if test "x$gcc_cv_objdump" != x; then
   if $gcc_cv_objdump -s conftest.o 2>/dev/null \
      | grep '04800a8e 78808080 80808080 808001' >/dev/null; then
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 09082e8ccae..072fe1d2b48 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3226,6 +3226,19 @@ L2:
 	.uleb128 0x8000000000000000
 ],
 [[
+case "$target" in
+  loongarch*-*-*)
+    if test "x$gcc_cv_ld" != x; then
+      ac_try='$gcc_cv_ld conftest.o -o conftest -e 0x0 >&5'
+      { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+      (eval $ac_try) 2>&5
+      ac_status=$?
+      $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+      test $ac_status = 0
+      mv conftest conftest.o
+    fi
+esac
+
 if test "x$gcc_cv_objdump" != x; then
   if $gcc_cv_objdump -s conftest.o 2>/dev/null \
      | grep '04800a8e 78808080 80808080 808001' >/dev/null; then
-- 
2.31.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-15  4:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-14 11:21 [PATCH] LoongArch: gcc: Modify gas uleb128 support test Lulu Cheng
2023-09-14 11:45 ` Xi Ruoyao
2023-09-14 11:54   ` chenglulu
2023-09-14 12:09     ` Xi Ruoyao
2023-09-15  3:59       ` mengqinggang

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).