]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
riscv64-pei uninitialised data writing relocs
authorAlan Modra <amodra@gmail.com>
Wed, 24 Jan 2024 22:11:14 +0000 (08:41 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 24 Jan 2024 22:11:14 +0000 (08:41 +1030)
Without this patch the r_offset field of struct external_reloc is
uninitialised when using objcopy.

* coff/riscv64.h (SWAP_IN_RELOC_OFFSET): Define.
(SWAP_OUT_RELOC_OFFSET): Define.

include/coff/riscv64.h

index 1a1d6f37c7d9819d3aba584321f27b43fab7cc39..dfff497bc1bae8e266e6bf056abf7afbe0cfa357 100644 (file)
@@ -60,5 +60,7 @@ struct external_reloc
 
 #define RELOC struct external_reloc
 #define RELSZ 14
+#define SWAP_IN_RELOC_OFFSET   H_GET_32
+#define SWAP_OUT_RELOC_OFFSET  H_PUT_32
 
 #endif /* COFF_RISCV64_H */