diff --git a/assets/initrd.toml b/assets/initrd.toml index 499a5c1..179dd27 100644 --- a/assets/initrd.toml +++ b/assets/initrd.toml @@ -8,6 +8,10 @@ # # initial application for the kernel to execute # # on startup +[[files]] +dest = "vdso.so" +source = "host/libvdso.so" + [[files]] dest = "screenfont.psf" source = "../assets/fonts/tamsyn8x16r.psf" diff --git a/scripts/templates/build.ninja.j2 b/scripts/templates/build.ninja.j2 index e15cab4..0f256f2 100644 --- a/scripts/templates/build.ninja.j2 +++ b/scripts/templates/build.ninja.j2 @@ -187,6 +187,7 @@ build $builddir/fatroot/efi/boot/bootx64.efi : cp $builddir/boot/boot.efi name = bootloader to FAT image build $builddir/fatroot/initrd.img : makerd ${srcroot}/assets/initrd.toml | $ + ${builddir}/host/libvdso.so $ ${builddir}/native/makerd $ ${builddir}/user/nulldrv diff --git a/src/arch/x86_64/vdso.ld b/src/arch/x86_64/vdso.ld index 83e1383..3c6217c 100644 --- a/src/arch/x86_64/vdso.ld +++ b/src/arch/x86_64/vdso.ld @@ -1,5 +1,6 @@ PHDRS { - rodata PT_LOAD FLAGS(4) FILEHDR PHDRS ; + headers PT_PHDR FLAGS(4) FILEHDR PHDRS ; + rodata PT_LOAD FLAGS(4) ; text PT_LOAD FLAGS(5) ; dynamic PT_DYNAMIC FLAGS(4) ; note PT_NOTE ; @@ -14,6 +15,7 @@ SECTIONS { *(.plt*) *(.note.*) *(.hash*) + *(.debug*) } .illegal.relocations : { @@ -53,6 +55,10 @@ SECTIONS { KEEP(*(.eh_frame_hdr)) } :eh_frame + .shstrtab : { + *(.shstrtab) + } + .text ALIGN(0x1000) : { *(.text*) *(.init*)