Skip to content

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

Merged
dpsmith merged 2 commits intoTrenchBoot:masterfrom
andyhhp:master
Jan 30, 2020
Merged

build: Use more hidden symbols to fix 32bit boot#21
dpsmith merged 2 commits intoTrenchBoot:masterfrom
andyhhp:master

Conversation

@andyhhp
Copy link
Collaborator

@andyhhp andyhhp commented Jan 28, 2020

{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

@andyhhp andyhhp force-pushed the master branch 2 times, most recently from 43970d3 to e1009ba Compare January 28, 2020 15:43
Copy link
Member

@krystian-hebel krystian-hebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested-by: Krystian Hebel krystian.hebel@3mdeb.com

andyhhp and others added 2 commits January 30, 2020 12:38
-fvisibility=hidden doesn't affect extern's, so use #pragma instead.

{lz,sl}_header, being non-hidden, breaks the 32bit boot because the compiler
emits an indirection through the GOT.

Reported-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com>
This should catch 32bit builds which emit an indirection through the GOT.

Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
@dpsmith dpsmith merged commit 7cf4d5d into TrenchBoot:master Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants