Skip to content

Commit

Permalink
EF_RISCV_N32: Add a bit definition in e_flags
Browse files Browse the repository at this point in the history
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 <shihua@iscas.ac.cn>
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
  • Loading branch information
Liaoshihua committed Nov 6, 2024
1 parent 786042d commit 378c166
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions riscv-elf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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*
|===

+
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 378c166

Please sign in to comment.