diff --git a/Makefile b/Makefile index c02cc94..99c1caa 100644 --- a/Makefile +++ b/Makefile @@ -170,7 +170,7 @@ FORMAT ?= --target efi-app-$(ARCH) ifneq ($(OBJCOPY_GTE224),1) $(error objcopy >= 2.24 is required) endif - $(OBJCOPY) -j .text -j .sdata -j .data \ + $(OBJCOPY) -j .text -j .sdata -j .data -j .data.ident \ -j .dynamic -j .dynsym -j .rel* \ -j .rela* -j .reloc -j .eh_frame \ -j .vendor_cert \ diff --git a/elf_aarch64_efi.lds b/elf_aarch64_efi.lds index 77770c2..4324dc9 100644 --- a/elf_aarch64_efi.lds +++ b/elf_aarch64_efi.lds @@ -15,6 +15,16 @@ SECTIONS _etext = .; } .dynamic : { *(.dynamic) } + + . = ALIGN(4096); + .note.gnu.build-id : { + *(.note.gnu.build-id) + } + .data.ident : { + *(.data.ident) + } + + . = ALIGN(4096); .data : { _data = .; @@ -37,7 +47,6 @@ SECTIONS . = ALIGN(16); _bss_end = .; } - .note.gnu.build-id : { *(.note.gnu.build-id) } . = ALIGN(4096); .vendor_cert : diff --git a/elf_arm_efi.lds b/elf_arm_efi.lds index ffa1eeb..0287293 100644 --- a/elf_arm_efi.lds +++ b/elf_arm_efi.lds @@ -15,6 +15,16 @@ SECTIONS _etext = .; } .dynamic : { *(.dynamic) } + + . = ALIGN(4096); + .note.gnu.build-id : { + *(.note.gnu.build-id) + } + .data.ident : { + *(.data.ident) + } + + . = ALIGN(4096); .data : { _data = .; @@ -37,9 +47,8 @@ SECTIONS . = ALIGN(16); _bss_end = .; } - .note.gnu.build-id : { *(.note.gnu.build-id) } - . = ALIGN(4096); + . = ALIGN(4096); .vendor_cert : { *(.vendor_cert) diff --git a/elf_ia32_efi.lds b/elf_ia32_efi.lds index 9da8109..2ba18c7 100644 --- a/elf_ia32_efi.lds +++ b/elf_ia32_efi.lds @@ -19,6 +19,14 @@ SECTIONS { *(.reloc) } + . = ALIGN(4096); + .note.gnu.build-id : { + *(.note.gnu.build-id) + } + .data.ident : { + *(.data.ident) + } + . = ALIGN(4096); .data : { @@ -38,7 +46,7 @@ SECTIONS *(.bss) *(COMMON) } - .note.gnu.build-id : { *(.note.gnu.build-id) } + . = ALIGN(4096); .vendor_cert : { diff --git a/elf_ia64_efi.lds b/elf_ia64_efi.lds index 39ffdda..e7d85e2 100644 --- a/elf_ia64_efi.lds +++ b/elf_ia64_efi.lds @@ -27,6 +27,14 @@ SECTIONS *(.sbss) *(.scommon) } + . = ALIGN(4096); + .note.gnu.build-id : { + *(.note.gnu.build-id) + } + .data.ident : { + *(.data.ident) + } + . = ALIGN(4096); .data : { @@ -41,7 +49,7 @@ SECTIONS *(.bss) *(COMMON) } - .note.gnu.build-id : { *(.note.gnu.build-id) } + . = ALIGN(4096); .vendor_cert : { diff --git a/elf_x86_64_efi.lds b/elf_x86_64_efi.lds index bb21bbb..81d21a0 100644 --- a/elf_x86_64_efi.lds +++ b/elf_x86_64_efi.lds @@ -24,6 +24,14 @@ SECTIONS { *(.reloc) } + . = ALIGN(4096); + .note.gnu.build-id : { + *(.note.gnu.build-id) + } + .data.ident : { + *(.data.ident) + } + . = ALIGN(4096); .data : { @@ -42,7 +50,7 @@ SECTIONS *(COMMON) *(.rel.local) } - .note.gnu.build-id : { *(.note.gnu.build-id) } + . = ALIGN(4096); .vendor_cert : { @@ -54,7 +62,11 @@ SECTIONS .rela : { *(.rela.data*) + } + .rela.got : { *(.rela.got) + } + .rela.stab : { *(.rela.stab) } _edata = .; diff --git a/version.c.in b/version.c.in index 9e71970..06f91f9 100644 --- a/version.c.in +++ b/version.c.in @@ -1,7 +1,7 @@ #include "version.h" -CHAR8 shim_version[] = +CHAR8 shim_version[] __attribute__((section (".data.ident"))) = "UEFI SHIM\n" "$Version: @@VERSION@@ $\n" "$BuildMachine: @@UNAME@@ $\n"