From: Waldemar Kozaczuk <[email protected]>
Committer: Waldemar Kozaczuk <[email protected]>
Branch: master

vmlinuz-boot.bin: remove unnecessary '-nostartfiles' and '-nodefaultlibs' 
linker flags

The vmlinuz-boot.bin is linked using the vmlinuz-boot.ld linked scripts so
the flags - '-nostartfiles' and '-nodefaultlibs' are unnecessary.
Worse they are incorrect and start triggering link errors with the version of
ld.bfd on Ubuntu 21.04.

This patch removes these linker flags.

Signed-off-by: Waldemar Kozaczuk <[email protected]>

---
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -438,8 +438,8 @@ $(out)/arch/x64/vmlinuz-boot32.o: $(out)/loader-stripped.elf
 $(out)/arch/x64/vmlinuz-boot32.o: ASFLAGS += -I$(out) 
-DOSV_KERNEL_SIZE=$(kernel_size)
 
 $(out)/vmlinuz-boot.bin: $(out)/arch/x64/vmlinuz-boot32.o 
arch/x64/vmlinuz-boot.ld
-       $(call quiet, $(LD) -nostartfiles -static -nodefaultlibs -o $@ \
-                       $(filter-out %.bin, $(^:%.ld=-T %.ld)), LD $@)
+       $(call quiet, $(LD) -static -o $@ \
+               $(filter-out %.bin, $(^:%.ld=-T %.ld)), LD $@)
 
 $(out)/vmlinuz.bin: $(out)/vmlinuz-boot.bin $(out)/loader-stripped.elf
        $(call quiet, dd if=$(out)/vmlinuz-boot.bin of=$@ > /dev/null 2>&1, DD 
vmlinuz.bin vmlinuz-boot.bin)

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/000000000000bf30b405d41a71d2%40google.com.

Reply via email to