]> git.ipfire.org Git - thirdparty/glibc.git/commit
m68k: Handle fewer relocations for RTLD_BOOTSTRAP (#BZ29071)
authorFangrui Song <maskray@google.com>
Wed, 20 Apr 2022 17:24:15 +0000 (10:24 -0700)
committerFangrui Song <maskray@google.com>
Wed, 20 Apr 2022 17:24:16 +0000 (10:24 -0700)
commita8e9b5b8079d18116ca69c9797e77804ecf2ee7e
tree0bdf2e984569e8369740ae861ef839cc1ffeb4cb
parent62be9681677e7ce820db721c126909979382d379
m68k: Handle fewer relocations for RTLD_BOOTSTRAP (#BZ29071)

m68k is a non-PI_STATIC_AND_HIDDEN arch which uses a GOT relocation when
loading the address of a jump table. The GOT load may be reordered
before processing R_68K_RELATIVE relocations, leading to an
unrelocated/incorrect jump table, which will cause a crash.

The foolproof approach is to add an optimization barrier (e.g. calling
an non-inlinable function after relative relocations are resolved). That
is non-trivial given the current code structure, so just use the simple
approach to avoid the jump table: handle only the essential reloctions
for RTLD_BOOTSTRAP code.

This is based on Andreas Schwab's patch and fixed ld.so crash on m68k.

Reviewed-by: Adheemrval Zanella <adhemerval.zanella@linaro.org>
sysdeps/m68k/dl-machine.h