Page 1 of 1
UEFI Linker error
Posted: Sat Jun 22, 2013 7:37 pm
by gabemaiberger
I am trying to compile lockdown.c for uefi secure boot testing but I get the linker error:
However, I already included efi.h.
Re: UEFI Linker error
Posted: Sun Jun 23, 2013 12:24 am
by iansjack
Isn't Print defined in efilib.h?
Re: UEFI Linker error
Posted: Sun Jun 23, 2013 9:54 am
by gabemaiberger
Yes it is. I think it is the way I am compiling it. Could you please explain how to compile an efi image with gcc. Btw, there are a lot more linker errors then I showed you. Here they all are:
Code: Select all
gabe@gabe-T3656:~/Programming/Projects/EFIApps/Lockdown$ gcc lockdown.c -o lockdown\
>
lockdown.c: In function ‘efi_main’:
lockdown.c:21:3: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
lockdown.c:26:3: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
lockdown.c:30:2: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
lockdown.c:39:3: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
lockdown.c:42:2: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
lockdown.c:50:3: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
lockdown.c:53:2: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
lockdown.c:73:3: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
lockdown.c:76:2: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
lockdown.c:80:3: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
lockdown.c:83:2: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
lockdown.c:90:3: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
lockdown.c:93:2: warning: passing argument 1 of ‘Print’ from incompatible pointer type [enabled by default]
In file included from lockdown.c:2:0:
/usr/include/efi/efilib.h:389:1: note: expected ‘CHAR16 *’ but argument is of type ‘int *’
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/tmp/ccM5uMZo.o: In function `efi_main':
lockdown.c:(.text+0x27): undefined reference to `InitializeLib'
lockdown.c:(.text+0x2e): undefined reference to `RT'
lockdown.c:(.text+0x4c): undefined reference to `GV_GUID'
lockdown.c:(.text+0x63): undefined reference to `uefi_call_wrapper'
lockdown.c:(.text+0x7d): undefined reference to `Print'
lockdown.c:(.text+0x9e): undefined reference to `Print'
lockdown.c:(.text+0xb7): undefined reference to `Print'
lockdown.c:(.text+0xc4): undefined reference to `RT'
lockdown.c:(.text+0xde): undefined reference to `GV_GUID'
lockdown.c:(.text+0xf5): undefined reference to `uefi_call_wrapper'
lockdown.c:(.text+0x116): undefined reference to `Print'
lockdown.c:(.text+0x12e): undefined reference to `Print'
lockdown.c:(.text+0x13b): undefined reference to `RT'
lockdown.c:(.text+0x155): undefined reference to `SIG_DB'
lockdown.c:(.text+0x16c): undefined reference to `uefi_call_wrapper'
lockdown.c:(.text+0x18d): undefined reference to `Print'
lockdown.c:(.text+0x1a5): undefined reference to `Print'
lockdown.c:(.text+0x1b2): undefined reference to `RT'
lockdown.c:(.text+0x1cc): undefined reference to `GV_GUID'
lockdown.c:(.text+0x1e3): undefined reference to `uefi_call_wrapper'
lockdown.c:(.text+0x204): undefined reference to `Print'
lockdown.c:(.text+0x21c): undefined reference to `Print'
lockdown.c:(.text+0x223): undefined reference to `RT'
lockdown.c:(.text+0x241): undefined reference to `GV_GUID'
lockdown.c:(.text+0x258): undefined reference to `uefi_call_wrapper'
lockdown.c:(.text+0x279): undefined reference to `Print'
lockdown.c:(.text+0x2a8): undefined reference to `Print'
lockdown.c:(.text+0x2af): undefined reference to `RT'
lockdown.c:(.text+0x2cd): undefined reference to `GV_GUID'
lockdown.c:(.text+0x2e4): undefined reference to `uefi_call_wrapper'
lockdown.c:(.text+0x305): undefined reference to `Print'
lockdown.c:(.text+0x331): undefined reference to `Print'
collect2: error: ld returned 1 exit status
Re: UEFI Linker error
Posted: Sun Jun 23, 2013 10:11 am
by iansjack
Well, the first thing you need to do is to #include "efilib.h" and then see what errors (if any) you are left with.