Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New attribute: Tag_RISCV_reserved_register #195

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions riscv-elf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +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_registers | 14 | uleb128 | Indicates the extra reserved register information.
| Reserved for non-standard attribute | >= 32768 | - | -
|===

Expand Down Expand Up @@ -942,6 +943,24 @@ 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_registers, 14, uleb128=register bit-vector

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.

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

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