]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
LoongArch: Warning about incorrect 3rd argument of .align
authorLulu Cai <cailulu@loongson.cn>
Mon, 19 May 2025 03:05:22 +0000 (11:05 +0800)
committercailulu <cailulu@loongson.cn>
Thu, 22 May 2025 01:26:17 +0000 (09:26 +0800)
344b1e0f5f7 Introduced range-check 3rd argument of .align, incorrect
value are not converted silently. added warning message to fix regression.

gas/testsuite/gas/loongarch/relax_align.d
gas/testsuite/gas/loongarch/relax_align.l [new file with mode: 0644]
gas/testsuite/gas/loongarch/relax_align.s

index fc1fd032611503122db18c0e166118e94d5dd1fd..a92df37c636985f851cdf73793d2802fec2ecaa0 100644 (file)
@@ -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 (file)
index 0000000..e33fa86
--- /dev/null
@@ -0,0 +1,3 @@
+.*Assembler messages:
+.*: Warning: ignoring out of range alignment maximum
+.*: Warning: ignoring out of range alignment maximum
index 4f4867fb209c7411a378ba81863988337eb00196..079f549895ca7d27ebe6d8395d99fc23556411a7 100644 (file)
@@ -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