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 <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
This commit is contained in:
Nigel Croxon 2017-04-07 13:16:58 -04:00
parent 574b48d8e4
commit 72a19c3a00

View file

@ -16,6 +16,9 @@ Revision History
--*/
#ifdef __GNUC__
#pragma GCC visibility push(hidden)
#endif
#include "efi.h"
#include "efilib.h"