From d6507e6fd9e0a6f1a8dd28c18cd320c1f861269e Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 3 Sep 2017 08:17:46 +0200 Subject: scripts/Makefile.lib: remove overridden target $(obj)/helloworld.so: The target $(obj)/helloworld.so: exists twice in Makefile.lib. If you add an echo command to each of the two recipes you get warnings like: scripts/Makefile.lib:383: warning: overriding recipe for target 'drivers/power/battery/helloworld.so' scripts/Makefile.lib:379: warning: ignoring old recipe for target 'drivers/power/battery/helloworld.so' This patch removes the obsolete target. Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- scripts/Makefile.lib | 2 -- 1 file changed, 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 2a7ed70..7bf6ef1 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -392,8 +392,6 @@ cmd_efi_ld = $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared \ EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS) -$(obj)/helloworld.so: $(EFI_LDS_PATH) - $(obj)/helloworld.so: $(obj)/helloworld.o arch/$(ARCH)/lib/$(EFI_CRT0) \ arch/$(ARCH)/lib/$(EFI_RELOC) $(call cmd,efi_ld) -- cgit v1.1 From 5e44489bc19dad344e0019f4a6926aa5f29b4456 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 5 Sep 2017 03:19:37 +0200 Subject: efi_loader: rename __efi_hello_world_* In scripts/Makefile.lib we build section including helloworld.efi. This allows to load the EFI binary with command 'bootefi hello'. scripts/Makefile.lib contains explicit references to strings containing helloworld and hello_world. This makes it impossible to generalize the coding to accomodate additional built in EFI binaries. Let us rename the variables __efi_hello_world_* to __efi_helloworld_*. Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- scripts/Makefile.lib | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 7bf6ef1..320e6c0 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -367,11 +367,11 @@ cmd_S_efi= \ ( \ echo '.section .rodata.efi.init,"a"'; \ echo '.balign 16'; \ - echo '.global __efi_hello_world_begin'; \ - echo '__efi_hello_world_begin:'; \ + echo '.global __efi_helloworld_begin'; \ + echo '__efi_helloworld_begin:'; \ echo '.incbin "$<" '; \ - echo '__efi_hello_world_end:'; \ - echo '.global __efi_hello_world_end'; \ + echo '__efi_helloworld_end:'; \ + echo '.global __efi_helloworld_end'; \ echo '.balign 16'; \ ) > $@ -- cgit v1.1 From b0763108eacfc27c9f60d2ebfdf9d4328cf0bc38 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 5 Sep 2017 16:07:17 +0200 Subject: scripts/Makefile.lib: generalize building built in EFI app Replace all occurences of helloworld by generalized forms. This allows us to build additional EFI applications that are included into the U-Boot binary without loading scripts/Makefile.lib with specific filenames. Signed-off-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- scripts/Makefile.lib | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 320e6c0..861a3dc 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -359,20 +359,22 @@ cmd_S_ttf= \ $(obj)/%.S: $(src)/%.ttf $(call cmd,S_ttf) -# EFI Hello World application +# EFI applications +# A Makefile target *.efi is built as EFI application. +# A Makefile target *_efi.S wraps *.efi as built-in EFI application. # --------------------------------------------------------------------------- # Generate an assembly file to wrap the EFI app -cmd_S_efi= \ -( \ - echo '.section .rodata.efi.init,"a"'; \ - echo '.balign 16'; \ - echo '.global __efi_helloworld_begin'; \ - echo '__efi_helloworld_begin:'; \ - echo '.incbin "$<" '; \ - echo '__efi_helloworld_end:'; \ - echo '.global __efi_helloworld_end'; \ - echo '.balign 16'; \ +cmd_S_efi= \ +( \ + echo '.section .rodata.$*.init,"a"'; \ + echo '.balign 16'; \ + echo '.global __efi_$*_begin'; \ + echo '__efi_$*_begin:'; \ + echo '.incbin "$<" '; \ + echo '__efi_$*_end:'; \ + echo '.global __efi_$*_end'; \ + echo '.balign 16'; \ ) > $@ $(obj)/%_efi.S: $(obj)/%.efi @@ -383,7 +385,7 @@ cmd_efi_objcopy = $(OBJCOPY) -j .header -j .text -j .sdata -j .data -j \ .dynamic -j .dynsym -j .rel* -j .rela* -j .reloc \ $(if $(EFI_TARGET),$(EFI_TARGET),-O binary) $^ $@ -$(obj)/%.efi: $(obj)/%.so +$(obj)/%.efi: $(obj)/%_efi.so $(call cmd,efi_objcopy) quiet_cmd_efi_ld = LD $@ @@ -392,7 +394,7 @@ cmd_efi_ld = $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared \ EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS) -$(obj)/helloworld.so: $(obj)/helloworld.o arch/$(ARCH)/lib/$(EFI_CRT0) \ +$(obj)/%_efi.so: $(obj)/%.o arch/$(ARCH)/lib/$(EFI_CRT0) \ arch/$(ARCH)/lib/$(EFI_RELOC) $(call cmd,efi_ld) -- cgit v1.1