From 378c166e9a73f162f7d1165aa367aaa88c0be0cb Mon Sep 17 00:00:00 2001 From: Liao Shihua Date: Fri, 19 May 2023 12:03:20 +0800 Subject: [PATCH] EF_RISCV_N32: Add a bit definition in e_flags EF_RISCV_N32 is for ILP32* ABI on RV64* ISA. It use ELF-32 Object File and needs a flag-bit in e_flags field. Signed-off-by: Liao Shihua Signed-off-by: Guo Ren --- riscv-elf.adoc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/riscv-elf.adoc b/riscv-elf.adoc index 9d4ea27f..8abb18bf 100644 --- a/riscv-elf.adoc +++ b/riscv-elf.adoc @@ -277,12 +277,12 @@ below. + [[e-flags-layout]] .Layout of e_flags -[cols="1,2,1,1,3,5"] +[cols="1,2,1,1,1,3,5"] [width=80%] |=== -| Bit 0 | Bits 1 - 2 | Bit 3 | Bit 4 | Bits 5 - 23 | Bits 24 - 31 +| Bit 0 | Bits 1 - 2 | Bit 3 | Bit 4 | Bit 5 | Bits 6 - 23 | Bits 24 - 31 -| RVC | Float ABI | RVE | TSO | *Reserved* | *Non-standard extensions* +| RVC | Float ABI | RVE | TSO | N32 | *Reserved* | *Non-standard extensions* |=== + @@ -320,6 +320,9 @@ below. EF_RISCV_TSO (0x0010)::: This bit is set when the binary requires the RVTSO memory consistency model. + EF_RISCV_N32 (0x0020)::: This bit is set when the binary requires the ILP32* + ABI on RV64* ISAs. + Until such a time that the *Reserved* bits (0x00ffffe0) are allocated by future versions of this specification, they shall not be set by standard software. Non-standard extensions are free to use bits 24-31 for any purpose. This may @@ -355,6 +358,9 @@ raise an error. TSO::: Input files can have different values for the TSO field; the linker should set this field if any of the input objects have the TSO field set. + N32::: Linker should report errors if object files of different value + for N32 field. + NOTE: The static linker may ignore the compatibility checks if all fields in the `e_flags` are zero and all sections in the input file are non-executable sections.