1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

elf: Fix _dl_debug_vdprintf to work before self-relocation

The strlen might trigger and invalid GOT entry if it used before
the process is self-relocated (for instance on dl-tunables if any
error occurs).

For i386, _dl_writev with PIE requires to use the old 'int $0x80'
syscall mode because the calling the TLS register (gs) is not yet
initialized.

Checked on x86_64-linux-gnu.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
Adhemerval Zanella
2023-11-06 17:25:40 -03:00
parent 680c597e9c
commit 434eca873f
4 changed files with 48 additions and 2 deletions

View File

@@ -16,6 +16,11 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
/* Mark symbols hidden in static PIE for early self relocation to work.
Note: string.h may have ifuncs which cannot be hidden on i686. */
#if BUILD_PIE_DEFAULT
# pragma GCC visibility push(hidden)
#endif
#include <gmp-mparam.h>
#include <gmp.h>
#include <limits.h>