BFD_RELOC_LARCH_TLS_LD_HI20,
BFD_RELOC_LARCH_TLS_GD_PC_HI20,
BFD_RELOC_LARCH_TLS_GD_HI20,
+ BFD_RELOC_LARCH_32_PCREL,
BFD_RELOC_LARCH_RELAX,
BFD_RELOC_UNUSED };
bfd_put (bits, input_bfd, opr1 - value, contents + rel->r_offset);
break;
+ /* For eh_frame and debug info. */
+ case R_LARCH_32_PCREL:
+ value -= sec_addr (input_section) + rel->r_offset;
+ value += rel->r_addend;
+ bfd_vma word = bfd_get (howto->bitsize, input_bfd,
+ contents + rel->r_offset);
+ word = (word & ~howto->dst_mask) | (value & howto->dst_mask);
+ bfd_put (howto->bitsize, input_bfd, word, contents + rel->r_offset);
+ r = bfd_reloc_ok;
+ break;
+
/* New reloc type.
R_LARCH_B16 ~ R_LARCH_TLS_GD_HI20. */
case R_LARCH_B16:
reloc_bits, /* adjust_reloc_bits */
"gd_hi20"), /* larch_reloc_type_name */
- LOONGARCH_HOWTO (R_LARCH_RELAX, /* type (99). */
+ LOONGARCH_HOWTO (R_LARCH_32_PCREL, /* type (99). */
+ 0, /* rightshift. */
+ 4, /* size. */
+ 32, /* bitsize. */
+ true, /* pc_relative. */
+ 0, /* bitpos. */
+ complain_overflow_dont, /* complain_on_overflow. */
+ bfd_elf_generic_reloc, /* special_function. */
+ "R_LARCH_32_PCREL", /* name. */
+ false, /* partial_inplace. */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ false, /* pcrel_offset */
+ BFD_RELOC_LARCH_32_PCREL, /* bfd_reloc_code_real_type */
+ NULL, /* adjust_reloc_bits */
+ NULL), /* larch_reloc_type_name */
+
+ LOONGARCH_HOWTO (R_LARCH_RELAX, /* type (100). */
0, /* rightshift */
1, /* size */
0, /* bitsize */
"BFD_RELOC_LARCH_TLS_LD_HI20",
"BFD_RELOC_LARCH_TLS_GD_PC_HI20",
"BFD_RELOC_LARCH_TLS_GD_HI20",
+ "BFD_RELOC_LARCH_32_PCREL",
"BFD_RELOC_LARCH_RELAX",
"@@overflow: BFD_RELOC_UNUSED@@",
};
ENUMX
BFD_RELOC_LARCH_TLS_GD_HI20
+ENUMX
+ BFD_RELOC_LARCH_32_PCREL
+
ENUMX
BFD_RELOC_LARCH_RELAX
case EM_AVR_OLD:
case EM_AVR:
return reloc_type == 36; /* R_AVR_32_PCREL. */
+ case EM_LOONGARCH:
+ return reloc_type == 99; /* R_LARCH_32_PCREL. */
case EM_MICROBLAZE:
return reloc_type == 2; /* R_MICROBLAZE_32_PCREL. */
case EM_OR1K:
%gd_hi20 (sym). */
RELOC_NUMBER (R_LARCH_TLS_GD_HI20, 98)
+/* For eh_frame and debug info. */
+RELOC_NUMBER (R_LARCH_32_PCREL, 99)
+
/* RELAX. */
-RELOC_NUMBER (R_LARCH_RELAX, 99)
+RELOC_NUMBER (R_LARCH_RELAX, 100)
END_RELOC_NUMBERS (R_LARCH_count)
#ld:
#readelf: -wf
#target: [check_as_cfi]
-#xfail: alpha-*-*ecoff hppa64-*-* tile*-*-* visium-*-* loongarch64-*-*
+#xfail: alpha-*-*ecoff hppa64-*-* tile*-*-* visium-*-*
Contents of the .eh_frame section: