about summary refs log tree commit diff
path: root/elf/constload1.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2021-01-11 09:04:53 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2021-01-13 13:35:00 +0000
commit86a4d3fa7d1bda3c02cf713cf289d6f893970117 (patch)
tree337a32e22b4157895cc701d3097acb76a2628103 /elf/constload1.c
parent2ef23b520597f4ea1790a669b83e608f24f4cf12 (diff)
downloadglibc-86a4d3fa7d1bda3c02cf713cf289d6f893970117.tar.gz
glibc-86a4d3fa7d1bda3c02cf713cf289d6f893970117.tar.xz
glibc-86a4d3fa7d1bda3c02cf713cf289d6f893970117.zip
elf: work around a gcc bug in elf_get_dynamic_info
Since commit 2f056e8a5dd4dc0f075413f931e82cede37d1057
"aarch64: define PI_STATIC_AND_HIDDEN",
building glibc with gcc-8 on aarch64 fails with

/BLD/elf/librtld.os: in function `elf_get_dynamic_info':
/SRC/elf/get-dynamic-info.h:70:(.text+0xad8): relocation truncated to
 fit: R_AARCH64_ADR_PREL_PG_HI21 against symbol `_rtld_local' defined
 in .data section in /BLD/elf/librtld.os

This is a gcc bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98618
The bug is fixed on gcc-10 and not yet backported. gcc-9 is affected,
but the issue happens to not trigger in glibc, gcc-8 and older seems
to miscompile rtld.os.

Rewriting the affected code in elf_get_dynamic_info seems to make the
issue go away on <= gcc-9.

The change makes the logic a bit clearer too (by separating the index
computation and array update) and drops an older gcc workaround (since
gcc 4.6 is no longer supported).

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'elf/constload1.c')
0 files changed, 0 insertions, 0 deletions