From: Lulu Cai Date: Mon, 19 May 2025 03:05:22 +0000 (+0800) Subject: LoongArch: Warning about incorrect 3rd argument of .align X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12b4fc15e7261c2557175b3d5bda64da79718359;p=thirdparty%2Fbinutils-gdb.git 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 --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