loongarch64_pei_vec garbage in objcopy'd relocs

Alan Modra amodra@gmail.com
Fri Aug 19 01:11:05 GMT 2022


Like commit a9c09a3667cc, but for loongarch64.

Note that I'm just making things consistent.  I have no idea whether
struct external_reloc in include/coff/loongarch64.h should have an
r_offset field.  If not, then this patch should be reverted at the
same time the r_offset field is removed.

	* coff-loongarch64.c (SWAP_IN_RELOC_OFFSET): Define.
	(SWAP_OUT_RELOC_OFFSET): Define.

diff --git a/bfd/coff-loongarch64.c b/bfd/coff-loongarch64.c
index 8013737a08a..f752efbb51d 100644
--- a/bfd/coff-loongarch64.c
+++ b/bfd/coff-loongarch64.c
@@ -71,6 +71,10 @@ static reloc_howto_type pe_loongarch64_std_reloc_howto[] =
 #define bfd_pe_print_pdata      NULL
 #endif
 
+/* Handle include/coff/loongarch64.h external_reloc.  */
+#define SWAP_IN_RELOC_OFFSET	H_GET_32
+#define SWAP_OUT_RELOC_OFFSET	H_PUT_32
+
 /* Return TRUE if this relocation should
    appear in the output .reloc section.  */
 

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list