Parcourir la source

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>

Nigel Croxon il y a 8 ans
Parent
commit
72a19c3a00
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      lib/lib.h

+ 3 - 0
lib/lib.h

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