[COMMIT osv master] vmlinuz-boot.bin: remove unnecessary '-nostartfiles' and '-nodefaultlibs' linker flags

3 views
Skip to first unread message

Commit Bot

unread,
Dec 27, 2021, 1:02:07 AM12/27/21
to osv...@googlegroups.com, Waldemar Kozaczuk
From: Waldemar Kozaczuk <jwkoz...@gmail.com>
Committer: Waldemar Kozaczuk <jwkoz...@gmail.com>
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 <jwkoz...@gmail.com>

---
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)
Reply all
Reply to author
Forward
0 new messages