Skip to content

Commit 2bccd96

Browse files
committed
Advise, but don't yet require, use of the GOT for medany weak undef
Closes: #126
1 parent 0bb85bd commit 2bccd96

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

riscv-elf.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,17 @@ a signed 32-bit offset, relative to the value of the `pc` register,
371371
can be produced.
372372
This code model is position independent.
373373

374+
As a special edge-case, undefined weak symbols must still be supported, whose
375+
addresses will be 0 and may be out of range depending on the address at which
376+
the code is linked. Any references to possibly-undefined weak symbols should be
377+
made indirectly through the GOT as is used for position-independent code. Not
378+
doing so is deprecated and a future version of this specification will require
379+
using the GOT, not just advise.
380+
381+
> NOTE: This is not yet a requirement as existing toolchains predating this
382+
> part of the specification do not adhere to this, and without improvements to
383+
> linker relaxation support doing so would regress performance and code size.
384+
374385
# <a name=c-types></a>C/C++ type details
375386

376387
## <a name=c-type-sizes></a>C/C++ type sizes and alignments

0 commit comments

Comments
 (0)