Skip to content

Commit

Permalink
Merge pull request #201 from riscv/weak-undef-got
Browse files Browse the repository at this point in the history
Advise, but don't yet require, use of the GOT for medany weak undef
  • Loading branch information
jrtc27 authored Aug 10, 2021
2 parents 1d5384e + 2bccd96 commit eb678d0
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 eb678d0

Please sign in to comment.