Skip to content

Commit

Permalink
Tweaks to Tag_RISCV_reserved_register description
Browse files Browse the repository at this point in the history
- The attribute name is plural now, Tag_RISCV_reserved_registers
- Make the distinction between the encoded value and the human
  readable syntax a bit clearer.
- Remove ambiguity from the grammar for the tag based on feedback.
- Add possibility for an empty register list to the grammar
- Remove the exception allowing merging of two objects files if
  one includes the tag and the other doesn't
  • Loading branch information
edward-jones authored and kito-cheng committed Jan 9, 2022
1 parent 628c0b2 commit 425426a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions riscv-elf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ value if the tag number is even.
| Tag_RISCV_priv_spec | 8 | uleb128 | Indicates the major version of the privileged specification.
| Tag_RISCV_priv_spec_minor | 10 | uleb128 | Indicates the minor version of the privileged specification.
| Tag_RISCV_priv_spec_revision | 12 | uleb128 | Indicates the revision version of the privileged specification.
| Tag_RISCV_reserved_register | 14 | uleb128 | Indicates the extra reserved register information.
| Tag_RISCV_reserved_registers | 14 | uleb128 | Indicates the extra reserved register information.
| Reserved for non-standard attribute | >= 32768 | - | -
|===

Expand Down Expand Up @@ -943,22 +943,23 @@ Tag_RISCV_priv_spec contains the major/minor/revision version information of
the privileged specification. It will report errors if object files of different
privileged specification versions are merged.

===== Tag_RISCV_reserved_register, 14, uleb128=register bit-vector
===== Tag_RISCV_reserved_registers, 14, uleb128=register bit-vector

Tag_RISCV_reserved_register contains the information about the reserved
registers which are not reserved by ABI, it might reserved by specific
compiler option like `-ffixed-x4` or special purpose ABI variant like
Tag_RISCV_reserved_registers contains the information about the reserved
registers which are not reserved by ABI. Registers might be reserved by specific
compiler option like `-ffixed-x4` or a special purpose ABI variant like
overlay ABI.

Format of Tag_RISCV_reserved_register is a bit-vector, each bit corresponding to
a register, the bit order is same as dwarf register number.
The encoding of Tag_RISCV_reserved_registers is a bit-vector, each bit
corresponding to a register. The bit number for a register is the same as DWARF
register numbers.

First bit is must set, used to distinguish between attribute is unset or having
empty reserved register set.

It will report errors if link object files with different
Tag_RISCV_reserved_register values, but allowed link with object with and
without Tag_RISCV_reserved_register value, the final value will take from the
object which has set Tag_RISCV_reserved_register.
It will report errors if object files are linked with different
Tag_RISCV_reserved_registers values, or if the tag is missing from any object
when the tag is set in at least one linked object.

== Code relaxation

Expand Down

0 comments on commit 425426a

Please sign in to comment.