Skip to content

Commit

Permalink
Wording and grammar tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
kito-cheng committed Nov 24, 2022
1 parent 20aaaae commit 8419b7e
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions riscv-elf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1137,8 +1137,8 @@ specification versions are merged.

=== Mapping Symbol

Section can have a mixture of code and data or code with different ISAs,
mapping symbol is a special symbol class used for describe the boundaries.
The section can have a mixture of code and data or code with different ISAs;
mapping symbol is a special symbol class used to describe the boundaries.

[%autowidth]
|===
Expand All @@ -1148,28 +1148,30 @@ mapping symbol is a special symbol class used for describe the boundaries.
| $x<ISA> | Start of a sequence of instructions with <ISA> extension.
|===

Mapping symbol for data(`$d`) means following region are data.
The mapping symbol for data(`$d`) means the following region is data.

Mapping symbol for instruction(`$x`) means following region are instructions,
and it has an optional ISA string, which means following code region are using
ISA different than the ISA recorded in arch attribute, the ISA information will
used until next instruction mapping symobl; an instruction mapping symobl
without ISA string means using ISA configuration from ELF attribute.
The mapping symbol for instruction(`$x`) means the following region are
instructions,
and it has an optional ISA string, which means the following code regions are
using ISA is different than the ISA recorded in the arch attribute;
the ISA information will used until the next instruction mapping symbol;
an instruction mapping symbol without ISA string means using ISA configuration
from ELF attribute.

Format and rule of the optional ISA string is same as Tag_RISCV_arch, must
Format and rule of the optional ISA string are same as Tag_RISCV_arch, must
having explicit version, more detailed rule please refer to <<Attributes>>.

NOTE: The use case for mapping symbol for instruction(`$x`) with ISA information is
used with ifunc, e.g. library are built with `rv64gc`, but few functions
like memcpy provide two version, one built with `rv64gc`, and one built with
`rv64gcv`, and select by ifunc mechanism at run-time; however the arch
attribute is recording for minimal execution environment requirement, so the ISA
information from arch attribute isn't enough for disassembler to disassemble the
`rv64gcv` version correctly.

NOTE: For toolchain implementation, linker are permit to merge the adjacency
mapping symbol if they are exactly same type, and strip tool are permit to
strip mapping symbol.
NOTE: The use case for mapping symbol for instruction(`$x`) with ISA information
is used with ifunc, e.g. libraries are built with `rv64gc`, but few functions
like memcpy provides two versions, one built with `rv64gc`, and one built with
`rv64gcv`, and select by ifunc mechanism at run-time; however, the arch
attribute is recording for minimal execution environment requirements, so the
ISA information from arch attribute is not enough for the disassembler to
disassemble the `rv64gcv` version correctly.

NOTE: For toolchain implementation, the linker is permitted to merge the
adjacency mapping symbol if they are exactly the same symbol name, and strip
tools are permitted to strip mapping symbol.

== Linker Relaxation

Expand Down

0 comments on commit 8419b7e

Please sign in to comment.