On 5/18/23 11:22, Peter Maydell wrote:
/usr/lib/gcc/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/lib/../lib/libc.a(init-first.o):
in function `__libc_init_first':
(.text+0x10): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against 
symbol
`__environ' defined in .bss section in
/usr/lib/gcc/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/lib/../lib/libc.a(environ.o)
/usr/bin/ld: (.text+0x10): warning: too many GOT entries for -fpic, please 
recompile with
-fPIC

This is really a bug in the host libc (more specifically, how
the libc.a was compiled), isn't it?

Ok, it's a silly typo that caused -fno-pie to be dropped.

Paolo

 We've only previously seen
it when trying to build the system emulation binaries statically,
but it looks like it's finally reared its head for the usermode
binaries here. IIRC it basically boils down to how big the final
executable is and whether you get unlucky with what gets linked
in and what order such that a reloc in libc ends up wanting to
access a GOT table entry that gets assigned too high an index.
Still, given the prevalence of libc that's been compiled -fpic
rather than -fPIC, we probably need to deal with it somehow.


Reply via email to