|
14 | 14 | * [Named ABIs](#named-abis)
|
15 | 15 | * [Default ABIs](#default-abis)
|
16 | 16 | * [Code models](#code-models)
|
| 17 | + * [Dynamic Linking](#dynamic-linking) |
17 | 18 | 3. [C/C++ type details](#c-types)
|
18 | 19 | * [C/C++ type sizes and alignments](#c-type-sizes)
|
19 | 20 | * [C/C++ type representations](#c-type-representation)
|
|
28 | 29 | * [Thread Local Storage](#thread-local-storage)
|
29 | 30 | * [Program Header Table](#program-header-table)
|
30 | 31 | * [Note Sections](#note-sections)
|
31 |
| - * [Dynamic Table](#dynamic-table) |
| 32 | + * [Dynamic Section](#dynamic-section) |
32 | 33 | * [Hash Table](#hash-table)
|
33 | 34 | * [Attributes](#Attributes)
|
34 | 35 | 5. [DWARF](#dwarf)
|
@@ -371,6 +372,21 @@ a signed 32-bit offset, relative to the value of the `pc` register,
|
371 | 372 | can be produced.
|
372 | 373 | This code model is position independent.
|
373 | 374 |
|
| 375 | +## <a name=dynamic-linking></a>Dynamic Linking |
| 376 | + |
| 377 | +Run-time linkers that use lazy binding must preserve all argument registers |
| 378 | +used in the standard calling convention for the ABI in use. Any functions that |
| 379 | +use additional argument registers must be annotated with |
| 380 | +`STO_RISCV_VARIANT_CC`, as defined in [Symbol Table](#symbol-table). |
| 381 | + |
| 382 | +> NOTE: |
| 383 | +> Vector registers have a variable size depending on the hardware |
| 384 | +> implementation and can be quite large. Saving/restoring all these vector |
| 385 | +> arguments in a run-time linker's lazy resolver would use a large amount of |
| 386 | +> stack space and hurt performance. This attribute allows vector registers to |
| 387 | +> not be part of the standard calling convention so run-time linkers are not |
| 388 | +> required to save/restore them and can instead eagerly bind such functions. |
| 389 | +
|
374 | 390 | # <a name=c-types></a>C/C++ type details
|
375 | 391 |
|
376 | 392 | ## <a name=c-type-sizes></a>C/C++ type sizes and alignments
|
@@ -519,7 +535,20 @@ There are no RISC-V specific definitions relating to ELF string tables.
|
519 | 535 |
|
520 | 536 | ## <a name=symbol-table></a>Symbol Table
|
521 | 537 |
|
522 |
| -There are no RISC-V specific definitions relating to ELF symbol tables. |
| 538 | +* st_other: The lower 2 bits are used to specify a symbol's visibility. The |
| 539 | + remaining 6 bits have no defined meaning in the ELF gABI. We use the highest |
| 540 | + bit to mark functions that do not follow the standard calling convention for |
| 541 | + the ABI in use. |
| 542 | + |
| 543 | + The defined processor-specific `st_other` flags are listed in the following |
| 544 | + table. |
| 545 | + |
| 546 | + Name | Mask |
| 547 | + :------------------- | :---- |
| 548 | + STO_RISCV_VARIANT_CC | 0x80 |
| 549 | + |
| 550 | + See [Dynamic Linking](#dynamic-linking) for the meaning of |
| 551 | + `STO_RISCV_VARIANT_CC`. |
523 | 552 |
|
524 | 553 | ## <a name=relocations></a>Relocations
|
525 | 554 |
|
@@ -1023,9 +1052,18 @@ PT_RISCV_ATTRIBUTES | 0x70000003 | RISC-V ELF attribute section.
|
1023 | 1052 |
|
1024 | 1053 | There are no RISC-V specific definitions relating to ELF note sections.
|
1025 | 1054 |
|
1026 |
| -## <a name=dynamic-table></a>Dynamic Table |
| 1055 | +## <a name=dynamic-section></a>Dynamic Section |
| 1056 | + |
| 1057 | +The defined processor-specific dynamic array tags are listed in the following |
| 1058 | +table. |
| 1059 | + |
| 1060 | +Name | Value | d_un | Executable | Shared Object |
| 1061 | +:------------------ | :--------- | :---- | :---------------- | :----------------- |
| 1062 | +DT_RISCV_VARIANT_CC | 0x70000001 | d_val | Platform specific | Platform specific |
1027 | 1063 |
|
1028 |
| -There are no RISC-V specific definitions relating to dynamic tables. |
| 1064 | +An object with the dynamic tag `DT_RISCV_VARIANT_CC` has one or more |
| 1065 | +`R_RISCV_JUMP_SLOT` relocations against symbols with the `STO_RISCV_VARIANT_CC` |
| 1066 | +attribute. |
1029 | 1067 |
|
1030 | 1068 | ## <a name=hash-table></a>Hash Table
|
1031 | 1069 |
|
|
0 commit comments