Skip to content

Commit 9287542

Browse files
committed
Adds Linux-specific ABI Section
The specification was previously over-perscriptive in the definitions of the size, alignment, and signedness of `wchar_t` and `wint_t`. After some discussion it has been agreed to split these definitions out from the main specification and into a separate section that only applies on Linux. This commit introduces that section with the existing definitions for `wchar_t` and `wint_t`.
1 parent c70c09d commit 9287542

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

riscv-elf.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
* [Hash Table](#hash-table)
2727
5. [DWARF](#dwarf)
2828
* [Dwarf Register Numbers](#dwarf-register-numbers)
29+
6. [Linux-specific ABI](#linux-abi)
30+
* [Linux-specific C type sizes and alignments](#linux-c-type-sizes)
31+
* [Linux-specific C type representations](#linux-c-type-representations)
2932

3033
## Copyright and license information
3134

@@ -833,3 +836,29 @@ Dwarf Number | Register Name | Description
833836
The alternate frame return column is meant to be used when unwinding from
834837
signal handlers, and stores the address where the signal handler will return
835838
to.
839+
840+
# <a name=linux-abi></a> Linux-specific ABI
841+
842+
**This section of the RISC-V ELF psABI specification only applies to Linux-based
843+
systems.**
844+
845+
In order to ensure compatibility between different implementations of the C
846+
library for Linux, we provide some extra definitions which only apply on those
847+
systems. These are noted in this section.
848+
849+
## <a name=linux-c-type-sizes></a> Linux-specific C type sizes and alignments
850+
851+
The following definitions apply for all ABIs defined in this document. Here
852+
there is no differentiation between ILP32 and LP64 abis.
853+
854+
Type | Size (Bytes) | Alignment (Bytes)
855+
------------|---------------|------------------
856+
wchar_t | 4 | 4
857+
wint_t | 4 | 4
858+
859+
## <a name=linux-c-type-representations></a> Linux-specific C type representations
860+
861+
The following definitions apply for all ABIs defined in this document. Here
862+
there is no differentiation between ILP32 and LP64 abis.
863+
864+
`wchar_t` is signed. `wint_t` is unsigned.

0 commit comments

Comments
 (0)