TrenchBoot / landing-zone

An open source implementation of an AMD-V Secure Loader.
GNU General Public License v2.0
23 stars 7 forks source link

build: Use more hidden symbols to fix 32bit boot #21

Closed andyhhp closed 4 years ago

andyhhp commented 4 years ago

{lz,sl}_header being non-hidden breaks the 32bit boot because of a GOT-relative access and no dynamic linker support.

Update the GLOBAL() macro to hide each symbol (includes _entry), and have the linker script emit a hidden symbol for _end. This results in no GOT-relative accesses, which fixes the 32bit boot.

Additionally, move -fvisibility=hidden to be common in the build, and check for any global non-hidden symbols, to hopefully prevent issues like this in the future.

Reported-by: Krystian Hebel krystian.hebel@3mdeb.com Signed-off-by: Andrew Cooper andrew.cooper3@citrix.com