Skip to content

Commit

Permalink
Merge pull request #372 from riscv-non-isa/mapping-symbol-uniquifier
Browse files Browse the repository at this point in the history
Allow optional uniquifier for mapping symbol
  • Loading branch information
kito-cheng authored Jun 9, 2023
2 parents 9401f64 + 46fc7e4 commit d72db56
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions riscv-elf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1185,9 +1185,12 @@ A number of symbols, named mapping symbols, describe the boundaries.
[%autowidth]
|===
| Symbol Name | Meaning
| $d | Start of a sequence of data.
| $x | Start of a sequence of instructions.
| $x<ISA> | Start of a sequence of instructions with <ISA> extension.
| $d .2+| Start of a sequence of data.
| $d.<any>
| $x .2+| Start of a sequence of instructions.
| $x.<any>
| $x<ISA> .2+| Start of a sequence of instructions with <ISA> extension.
| $x<ISA>.<any>
|===

The mapping symbol should set the type to `STT_NOTYPE`, binding to `STB_LOCAL`,
Expand All @@ -1206,6 +1209,9 @@ from ELF attribute.
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>>.

The mapping symbol can be followed by an optional uniquifier, which is prefixed
with a dot (`.`).

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
Expand Down

0 comments on commit d72db56

Please sign in to comment.