about summary refs log tree commit diff
path: root/sysdeps/unix/bsd/osf/alpha/sysdep.h
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2021-01-15 12:49:24 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2021-01-20 14:42:46 +0000
commit54afd0132a909969862bb2ce96bd5e95beab324a (patch)
tree23c80e1b4d9ec428dc94869db32be5adb4d0f3d5 /sysdeps/unix/bsd/osf/alpha/sysdep.h
parent4da71cb981057048e8cf9dec8731ad936b433e38 (diff)
downloadglibc-54afd0132a909969862bb2ce96bd5e95beab324a.tar.gz
glibc-54afd0132a909969862bb2ce96bd5e95beab324a.tar.xz
glibc-54afd0132a909969862bb2ce96bd5e95beab324a.zip
Use hidden visibility for early static PIE code
Extern symbol access in position independent code usually involves GOT
indirection which needs RELATIVE reloc in a static linked PIE. (On
some targets this is avoided e.g. because the linker can relax a GOT
access to a pc-relative access, but this is not generally true.) Code
that runs before static PIE self relocation must avoid relying on
dynamic relocations which can be ensured by using hidden visibility.
However we cannot just make all symbols hidden:

On i386, all calls to IFUNC functions must go through PLT and calls to
hidden functions CANNOT go through PLT in PIE since EBX used in PIE PLT
may not be set up for local calls to hidden IFUNC functions.

This patch aims to make symbol references hidden in code that is used
before and by _dl_relocate_static_pie when building a static PIE libc.
Note: for an object that is used in the startup code, its references
and definition may not have consistent visibility: it is only forced
hidden in the startup code.

This is needed for fixing bug 27072.

Co-authored-by: H.J. Lu <hjl.tools@gmail.com>
Diffstat (limited to 'sysdeps/unix/bsd/osf/alpha/sysdep.h')
0 files changed, 0 insertions, 0 deletions