Limine Bare Bones: Difference between revisions

Force ELF file type to ET_DYN
[unchecked revision][unchecked revision]
m (Bot: Replace deprecated source tag with syntaxhighlight)
(Force ELF file type to ET_DYN)
Line 342:
 
# Link rules for the final kernel executable.
# The magic printf/dd command is used to force the final ELF file type to ET_DYN.
# GNU binutils, for silly reasons, forces the ELF type to ET_EXEC even for
# relocatable PIEs, if the base load address is non-0.
# See https://sourceware.org/bugzilla/show_bug.cgi?id=31795 for more information.
bin/$(KERNEL): GNUmakefile linker.ld $(OBJ)
mkdir -p "$$(dirname $@)"
$(KLD) $(OBJ) $(KLDFLAGS) -o $@
printf '\x03' | dd of=$@ bs=1 count=1 seek=16 conv=notrunc
 
# Include header dependencies.