Skip to content
Commit 3fc1ccd8 authored by Stephanos Ioannidis's avatar Stephanos Ioannidis
Browse files

arch: arm64: Include GOT in RODATA



GCC 12 and above may emit "GOT indirections" for the weak symbol
references, and this requires the Global Offset Table (GOT) to be
included in the output.

This commit places the `.got` section in the RODATA section so that
the addresses of the weak symbols can be resolved at run-time. Note
that the GOT is populated with the symbol addresses at the default
linking address by the linker.

The `.got.plt` section, although unused, is also placed in the RODATA
section because the linker refuses to allow discarding this section
even when the `.plt` section is discarded.

In case of the GCC releases prior to 12, the weak symbol addresses are
placed in the literal pool and the `.got` section is not created at
all; therefore, this patch will be no-op.

For more details, refer to the following GitHub issue:
zephyrproject-rtos/sdk-ng#547.

Signed-off-by: default avatarStephanos Ioannidis <root@stephanos.io>
parent 7b1a8f4b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment