Error while linking with gnuefi
Posted: Sat May 14, 2016 2:44 pm
Hello OSDevers,
Today I went experimenting with UEFI for a new OS I'm writting. Everything went pretty well until just after I added code to read the disk to load the kernel, that stuff started to go wrong. My linker refused to link with this error:
I searched around for solutions to the error, but all I could find was wrong link order and people forgetting the library in the command line. I tried changing the link order but nothing worked.
The command used for linking is this:
I even recompiled the gnuefi and tried to use that instead of the fedora package(that's why the -L/usr/local/lib is there), but it made no difference.
I should mention that I'm compiling for x86_64 with the mingw compiler supplied by my distro's package(so there should be no problems there).
Thanks alot,
TheRussianFail
Today I went experimenting with UEFI for a new OS I'm writting. Everything went pretty well until just after I added code to read the disk to load the kernel, that stuff started to go wrong. My linker refused to link with this error:
Code: Select all
/usr/local/lib/libefi.a(dpath.o): could not read symbols: Invalid operation
The command used for linking is this:
Code: Select all
x86_64-w64-mingw32-gcc -Iinc -Iinc/x86_64 -Iinc/protocol -L/usr/local/lib -nostdlib -Wl,-dll -shared -Wl,--subsystem,10 -e efi_main -o BOOTX64.EFI entry.c kernel_loader.c -lefi -lgnuefi -lgcc
I should mention that I'm compiling for x86_64 with the mingw compiler supplied by my distro's package(so there should be no problems there).
Thanks alot,
TheRussianFail