From 72a19c3a00bd9d95cd0a1e073a71011a1031f572 Mon Sep 17 00:00:00 2001 From: Nigel Croxon Date: Fri, 7 Apr 2017 13:16:58 -0400 Subject: [PATCH] On x86_64, newish gcc will use relocation types R_X86_64_GOTPCREL, R_X86_64_GOTPCREL64, R_X86_64_GOTPCRELX, and R_X86_64_REX_GOTPCRELX, which our _relocate() does not support, for extern declarations visible to things linking against a DSO. Since we're really just building a .a here, and *nothing* needs to be exported in the .so sense, we don't need any of that optimization at all, there's no point in making _relocate() know how to handle these. Instead, this patch simply removes the visibility from everything in the .a, which gets us back to fairly normal relative relocations that wind up being R_X86_64_RELATIVE in the final binary, which we can handle. Signed-off-by: Peter Jones Signed-off-by: Nigel Croxon --- lib/lib.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/lib.h b/lib/lib.h index e8332df..37fbb95 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -16,6 +16,9 @@ Revision History --*/ +#ifdef __GNUC__ +#pragma GCC visibility push(hidden) +#endif #include "efi.h" #include "efilib.h"