Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reserve e_flags bits 24 through 31 for custom use #200

Merged
merged 1 commit into from
Aug 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions riscv-elf.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,9 @@ rules about 2×XLEN aligned arguments being passed in "aligned" register pa
* e_flags: Describes the format of this ELF file. These flags are used by the
linker to disallow linking ELF files with incompatible ABIs together.

Bit 0 | Bit 1 - 2 | Bit 3 | Bit 4 | Bit 5 - 31
-------|------------|-------|-------|------------
RVC | Float ABI | RVE | TSO | *Reserved*
Bit 0 | Bits 1 - 2 | Bit 3 | Bit 4 | Bits 5 - 23 | Bits 24 - 31
-------|------------|-------|-------|-------------|---------------------------
RVC | Float ABI | RVE | TSO | *Reserved* | *Non-standard extensions*
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dropped the "Reserved for" as otherwise the table gets rather wide


* EF_RISCV_RVC (0x0001): This bit is set when the binary targets the C ABI,
which allows instructions to be aligned to 16-bit boundaries (the base RV32
Expand All @@ -497,9 +497,18 @@ rules about 2×XLEN aligned arguments being passed in "aligned" register pa
* EF_RISCV_TSO (0x0010): This bit is set when the binary requires the RVTSO
memory consistency model.

Until such a time that the *Reserved* bits (0xffffffe0) are allocated by
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.
software. Non-standard extensions are free to use bits 24-31 for any purpose.
This many conflict with other non-standard extensions.

> NOTE:
> There is no provision for compatibility between conflicting uses of the
> e_flags bits reserved for non-standard extensions, and many standard RISC-V
> tools will ignore them. Do not use them unless you control both the
> toolchain and the operating system, and the ABI differences are so
> significant they cannot be done with a .RISCV.attributes tag nor an ELF
> note, such as using a different syscall ABI.

## <a name=sections></a>Sections

Expand Down