secureboot: Add .sbat section

This commit is contained in:
mintsuki 2021-06-25 01:23:26 +02:00
parent ece3e9c099
commit 60e1b43f66
4 changed files with 32 additions and 1 deletions

View File

@ -195,7 +195,7 @@ $(BUILDDIR)/full.map.o: $(BUILDDIR)/limine_efi_nomap.elf
"$$GENSYMS" $(TOOLCHAIN_OBJDUMP) $< full 64
$(BUILDDIR)/BOOTX64.EFI: $(BUILDDIR)/limine_efi.elf
$(TOOLCHAIN_OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .rel.* -j .rela.* -j .reloc --target efi-app-x86_64 --subsystem=10 $< $@
$(TOOLCHAIN_OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .rel.* -j .rela.* -j .reloc -j .sbat --target efi-app-x86_64 --subsystem=10 $< $@
$(BUILDDIR)/limine_efi_nomap.elf: $(OBJ) $(BUILDDIR)/font.o $(BUILDDIR)/sys/smp_trampoline.o
$(TOOLCHAIN_LD) \

View File

@ -54,6 +54,17 @@ SECTIONS
_edata = .;
_data_size = . - _etext;
. = ALIGN(4096);
.sbat :
{
_sbat = .;
*(.sbat)
*(.sbat.*)
}
_esbat = .;
_sbat_size = . - _sbat;
. = ALIGN(4096);
.dynamic : { *(.dynamic) }
. = ALIGN(4096);

View File

@ -54,6 +54,17 @@ SECTIONS
_edata = .;
_data_size = . - _etext;
. = ALIGN(4096);
.sbat :
{
_sbat = .;
*(.sbat)
*(.sbat.*)
}
_esbat = .;
_sbat_size = . - _sbat;
. = ALIGN(4096);
.dynamic : { *(.dynamic) }
. = ALIGN(4096);

9
stage23/sbat.c Normal file
View File

@ -0,0 +1,9 @@
#if defined (uefi)
asm (
".section .sbat\n\t"
".ascii \"sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md\\n\"\n\t"
".ascii \"limine,1,Limine,limine," LIMINE_VERSION ",https://limine-bootloader.org\\n\"\n\t"
);
#endif