]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
LoongArch: Change DWARF2_CIE_DATA_ALIGNMENT to -4 for loongarch32
authorJiajie Chen <c@jia.je>
Mon, 16 Dec 2024 07:27:36 +0000 (15:27 +0800)
committermengqinggang <mengqinggang@loongson.cn>
Wed, 10 Dec 2025 08:06:47 +0000 (16:06 +0800)
gas/config/tc-loongarch.c
gas/config/tc-loongarch.h

index df5cf9d903c69cf043e779550324e5a8a7b95988..2c53771a839c3b6fbe225593429f5edcbea9b4d2 100644 (file)
@@ -118,6 +118,9 @@ static const char default_arch[] = DEFAULT_ARCH;
 
 static bool call36 = 0;
 
+/* The dwarf2 data alignment, adjusted for 32 or 64 bit.  */
+int loongarch_cie_data_alignment;
+
 /* The lowest 4-bit is the bytes of instructions.  */
 #define RELAX_BRANCH_16 0xc0000014
 #define RELAX_BRANCH_21 0xc0000024
@@ -515,6 +518,8 @@ md_begin ()
   /* FIXME: expressionS use 'offsetT' as constant,
    * we want this is 64-bit type.  */
   assert (8 <= sizeof (offsetT));
+
+  loongarch_cie_data_alignment = LARCH_opts.ase_lp64 ? (-8) : (-4);
 }
 
 /* Called just before the assembler exits.  */
index 38ecd036d3492913e2662a9cdde035c6e1293a25..a2444aae0d190e17f536d8355a72352981c41dd9 100644 (file)
@@ -108,7 +108,8 @@ extern bool loongarch_force_relocation_sub_same(struct fix *, asection *);
    FDE Code Alignment Factor (DWARF2_LINE_MIN_INSN_LENGTH) should be 1
    because DW_CFA_advance_loc need to be relocated in bytes
    when linker relaxation.  */
-#define DWARF2_CIE_DATA_ALIGNMENT     (-8)
+extern int loongarch_cie_data_alignment;
+#define DWARF2_CIE_DATA_ALIGNMENT loongarch_cie_data_alignment
 #define DWARF2_DEFAULT_RETURN_COLUMN  1            /* FDE Return Address Register.  */
 
 #define tc_cfi_frame_initial_instructions      \