Skip to content

Commit

Permalink
Merge pull request #360 from riscv-non-isa/fix-352
Browse files Browse the repository at this point in the history
Define mandatory/optional attribute tag
  • Loading branch information
kito-cheng authored Feb 20, 2023
2 parents 3c1fc34 + 9f480ab commit 87f4a72
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions riscv-elf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1020,8 +1020,16 @@ and name .riscv.attributes. The value of an attribute can hold an integer
encoded in the uleb128 format or a null-terminated byte string (NTBS).
The tag number is also encoded as uleb128.

RISC-V attributes have a string value if the tag number is odd and an integer
value if the tag number is even.
In order to improve the compatibility of the tool, the attribute follows below rules:

- RISC-V attributes have a string value if the tag number is odd and an integer
value if the tag number is even.

- The tag is mandatory; If the tool does not recognize this attribute and the tag number
modulo 128 is less than 64 (`(N % 128) < 64`), errors should be reported.

- The tag is optional; If the tool does not recognize this attribute and the tag number
modulo 128 is greater than or equal to 64 (`(N % 128) >= 64`), the tag can be ignored.

==== Layout of .riscv.attributes section

Expand Down

0 comments on commit 87f4a72

Please sign in to comment.