Skip to content
Commit d3feff22 authored by Fangrui Song's avatar Fangrui Song
Browse files

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: default avatarAdheemrval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit a8e9b5b8)
parent 68d3a9a6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment