瀏覽代碼

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 8 年之前
父節點
當前提交
72a19c3a00
共有 1 個文件被更改,包括 3 次插入0 次删除
  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"