[binutils-gdb] LoongArch: Warning about incorrect 3rd argument of .align
liu zhensong
liuzhensong@sourceware.org
Thu May 22 01:28:33 GMT 2025
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=12b4fc15e7261c2557175b3d5bda64da79718359
commit 12b4fc15e7261c2557175b3d5bda64da79718359
Author: Lulu Cai <cailulu@loongson.cn>
Date: Mon May 19 11:05:22 2025 +0800
LoongArch: Warning about incorrect 3rd argument of .align
344b1e0f5f7 Introduced range-check 3rd argument of .align, incorrect
value are not converted silently. added warning message to fix regression.
Diff:
---
gas/testsuite/gas/loongarch/relax_align.d | 6 ++++++
gas/testsuite/gas/loongarch/relax_align.l | 3 +++
gas/testsuite/gas/loongarch/relax_align.s | 6 ++++--
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/gas/testsuite/gas/loongarch/relax_align.d b/gas/testsuite/gas/loongarch/relax_align.d
index fc1fd032611..a92df37c636 100644
--- a/gas/testsuite/gas/loongarch/relax_align.d
+++ b/gas/testsuite/gas/loongarch/relax_align.d
@@ -1,6 +1,7 @@
#as:
#objdump: -dr
#skip: loongarch32-*-*
+#warning_output: relax_align.l
.*:[ ]+file format .*
@@ -44,3 +45,8 @@ Disassembly of section .text:
[ ]+68:[ ]+03400000[ ]+nop
[ ]+6c:[ ]+03400000[ ]+nop
[ ]+70:[ ]+4c000020[ ]+ret
+[ ]+74:[ ]+03400000[ ]+nop
+[ ]+74: R_LARCH_ALIGN[ ]+\*ABS\*\+0xc
+[ ]+78:[ ]+03400000[ ]+nop
+[ ]+7c:[ ]+03400000[ ]+nop
+[ ]+80:[ ]+4c000020[ ]+ret
diff --git a/gas/testsuite/gas/loongarch/relax_align.l b/gas/testsuite/gas/loongarch/relax_align.l
new file mode 100644
index 00000000000..e33fa86f7f3
--- /dev/null
+++ b/gas/testsuite/gas/loongarch/relax_align.l
@@ -0,0 +1,3 @@
+.*Assembler messages:
+.*: Warning: ignoring out of range alignment maximum
+.*: Warning: ignoring out of range alignment maximum
diff --git a/gas/testsuite/gas/loongarch/relax_align.s b/gas/testsuite/gas/loongarch/relax_align.s
index 4f4867fb209..079f549895c 100644
--- a/gas/testsuite/gas/loongarch/relax_align.s
+++ b/gas/testsuite/gas/loongarch/relax_align.s
@@ -1,5 +1,4 @@
-# If max < -0x80000000, max becomes a positive number because type conversion
-# (bfd_signed_vma -> unsigned int).
+# Range of max: 0<= max <= 0xffffffff
.text
.L1:
ret
@@ -13,6 +12,9 @@
ret
.align 4, , 12
ret
+ .align 4, , 0xffffffff
+ ret
+# ignore out of range alignment maxumum
.align 4, , -1
ret
.align 4, , -0x80000000
More information about the Binutils-cvs
mailing list