Skip to content

Commit

Permalink
Advise, but don't yet require, use of the GOT for medany weak undef
Browse files Browse the repository at this point in the history
Closes: #126
  • Loading branch information
jrtc27 committed Jul 30, 2021
1 parent 0bb85bd commit 2bccd96
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions riscv-elf.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,17 @@ a signed 32-bit offset, relative to the value of the `pc` register,
can be produced.
This code model is position independent.

As a special edge-case, undefined weak symbols must still be supported, whose
addresses will be 0 and may be out of range depending on the address at which
the code is linked. Any references to possibly-undefined weak symbols should be
made indirectly through the GOT as is used for position-independent code. Not
doing so is deprecated and a future version of this specification will require
using the GOT, not just advise.

> NOTE: This is not yet a requirement as existing toolchains predating this
> part of the specification do not adhere to this, and without improvements to
> linker relaxation support doing so would regress performance and code size.
# <a name=c-types></a>C/C++ type details

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

0 comments on commit 2bccd96

Please sign in to comment.