riscv64-pei uninitialised data writing relocs

Message ID ZbGfgJ8PBNvw3e67@squeak.grove.modra.org
State Unresolved
Headers
Series riscv64-pei uninitialised data writing relocs |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Alan Modra Jan. 24, 2024, 11:38 p.m. UTC
  Without this patch the r_offset field of struct external_reloc is
uninitialised when using objcopy.

Please note that riscv64-pei is only useful for obcopy, objump, nm and
the other tools in the binutils directory.  gas and ld are not
supported.

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

Patch

diff --git a/include/coff/riscv64.h b/include/coff/riscv64.h
index 1a1d6f37c7d..dfff497bc1b 100644
--- a/include/coff/riscv64.h
+++ b/include/coff/riscv64.h
@@ -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 */