Skip to content

Commit

Permalink
Address MaskRay's comment and apply his suggesion
Browse files Browse the repository at this point in the history
  • Loading branch information
kito-cheng committed Feb 20, 2023
1 parent 927bef1 commit 004ef70
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions riscv-elf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,8 @@ specification versions are merged.

=== Mapping Symbol

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.
The section can have a mixture of code and data or code with different ISAs.
A number of symbols, named mapping symbols, describe the boundaries.

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

The mapping symbol for data(`$d`) means the following region is data.
The mapping symbol should set the type to `STT_NOTYPE`, binding to `STB_LOCAL`,
and the size of symbol to zero.

The mapping symbol for instruction(`$x`) means the following region are
instructions,
The mapping symbol for data(`$d`) indicates the start of a sequence of data bytes.

The mapping symbol for instruction(`$x`) indicates the start of a sequence of
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 are 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
Expand All @@ -1191,10 +1194,6 @@ 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

At link time, when all the memory objects have been resolved, the code sequence
Expand Down

0 comments on commit 004ef70

Please sign in to comment.