]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[efi] Fix building elf2efi.c when -fpic is enabled by default
authorMichael Brown <mcb30@ipxe.org>
Wed, 25 Jan 2017 08:00:50 +0000 (08:00 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 25 Jan 2017 08:15:21 +0000 (08:15 +0000)
The x86_64 EDK2 headers include a #pragma to mark all subsequent
symbol declarations and references as hidden if position-independent
code is being generated.  Since libgen.h is currently included only
after the EDK2 headers, this results in __xpg_basename() being
erroneously marked as having hidden visibility (if the compiler
defaults to building position-independent code); this eventually
results in a failure to link the elf2efi binary.

Fix by including libgen.h prior to including the EDK2 headers.

Originally-fixed-by: Doug Goldstein <cardoe@cardoe.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/util/elf2efi.c

index 152bf533356cfd568cbbf2d607a205d6074dfe49..27f37d98a6d6a3119272611bf0b1c7db29a11add 100644 (file)
@@ -32,9 +32,9 @@
 #include <sys/mman.h>
 #include <fcntl.h>
 #include <elf.h>
+#include <libgen.h>
 #include <ipxe/efi/Uefi.h>
 #include <ipxe/efi/IndustryStandard/PeImage.h>
-#include <libgen.h>
 
 #define eprintf(...) fprintf ( stderr, __VA_ARGS__ )