optimized away or compressed by the linker during relaxation, to prevent
the assembler from computing static offsets across such an instruction.
- This is necessary to get correct .eh_frame cfa info. If one cfa's two
- symbol is not in the same frag, it will generate relocs to calculate
- symbol subtraction. (gas/dw2gencfi.c:output_cfi_insn:
- if (symbol_get_frag (to) == symbol_get_frag (from))) */
+ This is necessary to get correct .eh_frame FDE DW_CFA_advance_loc info.
+ If one cfi_insn_data's two symbols are not in the same frag, it will
+ generate ADD and SUB relocations pairs to calculate DW_CFA_advance_loc.
+ (gas/dw2gencfi.c: output_cfi_insn:
+ if (symbol_get_frag (to) == symbol_get_frag (from)))
+
+ For macro instructions, only the first instruction expanded from macro
+ need to start a new frag. */
if (LARCH_opts.relax
&& (BFD_RELOC_LARCH_PCALA_HI20 == reloc_info[0].type
- || BFD_RELOC_LARCH_GOT_PC_HI20 == reloc_info[0].type))
+ || BFD_RELOC_LARCH_GOT_PC_HI20 == reloc_info[0].type
+ || BFD_RELOC_LARCH_TLS_LE_HI20_R == reloc_info[0].type
+ || BFD_RELOC_LARCH_TLS_LE_ADD_R == reloc_info[0].type
+ || BFD_RELOC_LARCH_TLS_LD_PC_HI20 == reloc_info[0].type
+ || BFD_RELOC_LARCH_TLS_GD_PC_HI20 == reloc_info[0].type
+ || BFD_RELOC_LARCH_TLS_DESC_PC_HI20 == reloc_info[0].type))
{
frag_wane (frag_now);
frag_new (0);
--- /dev/null
+#as: -mrelax
+#objdump: -Dr -j .eh_frame
+#skip: loongarch32-*-*
+
+.*:[ ]+file format .*
+
+
+Disassembly of section .eh_frame:
+
+[ ]*0000000000000000 <.eh_frame>:
+[ ]+0:[ ]+00000014[ ]+.word[ ]+[ ]+0x00000014
+[ ]+4:[ ]+00000000[ ]+.word[ ]+[ ]+0x00000000
+[ ]+8:[ ]+00527a01[ ]+.word[ ]+[ ]+0x00527a01
+[ ]+c:[ ]+01017c01[ ]+fadd.d[ ]+\$fa1, \$fa0, \$fs7
+[ ]+10:[ ]+0c030d1b[ ]+.word[ ]+[ ]+0x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