Skip to content

Commit 9f480ab

Browse files
committed
Define mandatory/optional attribute tag
It's mandatory when (tag number % 128) < 64 and optional when (tag number % 128) >= 64. Fix #352
1 parent 3c1fc34 commit 9f480ab

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

riscv-elf.adoc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,8 +1020,16 @@ and name .riscv.attributes. The value of an attribute can hold an integer
10201020
encoded in the uleb128 format or a null-terminated byte string (NTBS).
10211021
The tag number is also encoded as uleb128.
10221022

1023-
RISC-V attributes have a string value if the tag number is odd and an integer
1024-
value if the tag number is even.
1023+
In order to improve the compatibility of the tool, the attribute follows below rules:
1024+
1025+
- RISC-V attributes have a string value if the tag number is odd and an integer
1026+
value if the tag number is even.
1027+
1028+
- The tag is mandatory; If the tool does not recognize this attribute and the tag number
1029+
modulo 128 is less than 64 (`(N % 128) < 64`), errors should be reported.
1030+
1031+
- The tag is optional; If the tool does not recognize this attribute and the tag number
1032+
modulo 128 is greater than or equal to 64 (`(N % 128) >= 64`), the tag can be ignored.
10251033

10261034
==== Layout of .riscv.attributes section
10271035

0 commit comments

Comments
 (0)