Skip to content

Commit d73b787

Browse files
committed
Revise for words.
1 parent 081a424 commit d73b787

File tree

1 file changed

+32
-29
lines changed

1 file changed

+32
-29
lines changed

riscv-elf.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -995,9 +995,9 @@ The following table lists the special sections defined by this ABI.
995995

996996
Name | Type | Attributes
997997
:------------------------- | :------------------- | :-------------
998-
.riscv.attributes. | SHT_RISCV_ATTRIBUTES | none
998+
.riscv.attributes | SHT_RISCV_ATTRIBUTES | none
999999

1000-
.riscv.attributes. names a section that contains RISC-V ELF attributes.
1000+
.riscv.attributes names a section that contains RISC-V ELF attributes.
10011001

10021002
## <a name=program-header-table></a>Program Header Table
10031003

@@ -1017,22 +1017,25 @@ There are no RISC-V specific definitions relating to ELF hash tables.
10171017

10181018
## <a name=Attributes></a>Attributes
10191019

1020-
Attributes are used to record the information about an object file/binary that a
1021-
linker or runtime loader needs to check the compatibility.
1022-
Attributes are encoded in an vendor-specific section of type
1023-
SHT_RISCV_ATTRIBUTES and name .riscv.attributes. The value of an attribute
1024-
can hold an integer encoded in the uleb128 format, a null-terminated byte
1025-
string (NTBS), or a combination of an integer and a string.
1020+
Attributes are used to record information about an object file/binary that a
1021+
linker or runtime loader needs to check compatibility.
1022+
1023+
Attributes are encoded in a vendor-specific section of type SHT_RISCV_ATTRIBUTES
1024+
and name .riscv.attributes. The value of an attribute can hold an integer
1025+
encoded in the uleb128 format or a null-terminated byte string (NTBS).
1026+
1027+
RISC-V attributes have a string value if the tag number is odd and an integer
1028+
value if the tag number is even.
10261029

10271030
### List of attributes
1028-
Tag | Value | Parameter type | Description
1029-
:--------------------------- | :---- | :------------- | :---------------------
1030-
Tag_RISCV_stack_align | 4 | uleb128 | Indicates the stack alignment requirement in bytes.
1031-
Tag_RISCV_arch | 5 | NTBS | Indicates the target architecture of this object.
1032-
Tag_RISCV_unaligned_access | 6 | uleb128 | Indicates whether to impose unaligned memory accesses in code generation.
1033-
Tag_RISCV_priv_spec | 8 | uleb128 | Indicates the major version of the privileged specification.
1034-
Tag_RISCV_priv_spec_minor | 10 | uleb128 | Indicates the minor version of the privileged specification.
1035-
Tag_RISCV_priv_spec_revision | 12 | uleb128 | Indicates the revision version of the privileged specification.
1031+
Tag | Value | Parameter type | Description
1032+
:---------------------------------- | :------- | :------------- | :---------------------
1033+
Tag_RISCV_stack_align | 4 | uleb128 | Indicates the stack alignment requirement in bytes.
1034+
Tag_RISCV_arch | 5 | NTBS | Indicates the target architecture of this object.
1035+
Tag_RISCV_unaligned_access | 6 | uleb128 | Indicates whether to impose unaligned memory accesses in code generation.
1036+
Tag_RISCV_priv_spec | 8 | uleb128 | Indicates the major version of the privileged specification.
1037+
Tag_RISCV_priv_spec_minor | 10 | uleb128 | Indicates the minor version of the privileged specification.
1038+
Tag_RISCV_priv_spec_revision | 12 | uleb128 | Indicates the revision version of the privileged specification.
10361039

10371040
### Detailed attribute description
10381041

@@ -1042,37 +1045,37 @@ Each attribute is described in the following structure:
10421045
```<Tag name>, <Value>, <Parameter type 1>=<Parameter name 1>[, <Parameter type 2>=<Parameter name 2>]```
10431046

10441047
#### Tag_RISCV_stack_align, 4, uleb128=value
1045-
Tag_RISCV_strict_align records the N-byte stack alignment for this object. The default
1046-
value is 16 for RV32I or RV64I, and 4 for RV32E.
1048+
Tag_RISCV_strict_align records the N-byte stack alignment for this object. The
1049+
default value is 16 for RV32I or RV64I, and 4 for RV32E.
10471050

10481051
The smallest value will be used if object files with different Tag_RISCV_stack_align
10491052
values are merged.
10501053

10511054
#### Tag_RISCV_arch, 5, NTBS=subarch
1052-
Tag_RISCV_arch contains the string about the target architecture from the option
1053-
`-march`. Different architectures will be integrated into a superset when object
1054-
files are merged.
1055-
1056-
Note that the version information of target architecture must be presented
1057-
explicitly in the attribute and abbreviation must be expanded. The version
1058-
information, if not given by `-march`, must be accordance with the default
1059-
specified by the tool. For example, the architecture RV32I” had to be recorded
1055+
Tag_RISCV_arch contains a string for the target architecture taken from
1056+
the option `-march`. Different architectures will be integrated into a superset
1057+
when object files are merged.
1058+
1059+
Note that the version information for target architecture must be presented
1060+
explicitly in the attribute and abbreviations must be expanded. The version
1061+
information, if not given by `-march`, must agree with the default
1062+
specified by the tool. For example, the architecture `RV32I` has to be recorded
10601063
in the attribute as `RV32I2P0` in which `2P0` stands for the default version of
10611064
its based ISA. On the other hand, the architecture `RV32G` has to be presented
10621065
as `RV32I2P0_M2P0_A2P0_F2P0_D2P0` in which the abbreviation `G` is expanded
10631066
to the IMAFD combination with default versions of the standard extensions.
10641067

10651068
#### Tag_RISCV_unaligned_access, 6, uleb128=value
1066-
Tag_RISCV_unaligned_access denotes the code generation policy for this object file.
1067-
Its values are defined as follows:
1069+
Tag_RISCV_unaligned_access denotes the code generation policy for this object
1070+
file. Its values are defined as follows:
10681071
- 0: This object does not allow any unaligned memory accesses.
10691072
- 1: This object allows unaligned memory accesses.
10701073

10711074
#### Tag_RISCV_priv_spec, 8, uleb128=version
10721075
#### Tag_RISCV_priv_spec_minor, 10, uleb128=version
10731076
#### Tag_RISCV_priv_spec_revision, 12, uleb128=version
10741077

1075-
Tag_RISCV_priv_spec contains the major/minor/revision version information about
1078+
Tag_RISCV_priv_spec contains the major/minor/revision version information of
10761079
the privileged specification. It will report errors if object files of different
10771080
privileged specification versions are merged.
10781081

0 commit comments

Comments
 (0)