diff --git a/README.gnuefi b/README.gnuefi index a7feec0..512698c 100644 --- a/README.gnuefi +++ b/README.gnuefi @@ -231,11 +231,17 @@ and page sized.These eight sections are used to group together the much greater number of sections that are typically present in ELF object files. Specifically: - .hash + .hash (and/or .gnu.hash) Collects the ELF .hash info (this section _must_ be the first section in order to build a shared object file; the section is not actually loaded or used at runtime). + GNU binutils provides a mechanism to generate different hash info + via --hash-style= option. In this case output + shared object will contain .hash section, .gnu.hash section or + both. In order to generate correct output linker script preserves + both types of hash sections. + .text Collects all sections containing executable code. diff --git a/gnuefi/elf_ia32_efi.lds b/gnuefi/elf_ia32_efi.lds index 6cc4ce1..f27fe5f 100644 --- a/gnuefi/elf_ia32_efi.lds +++ b/gnuefi/elf_ia32_efi.lds @@ -5,7 +5,9 @@ SECTIONS { . = 0; ImageBase = .; - .hash : { *(.hash) } /* this MUST come first! */ + /* .hash and/or .gnu.hash MUST come first! */ + .hash : { *(.hash) } + .gnu.hash : { *(.gnu.hash) } . = ALIGN(4096); .text : { diff --git a/gnuefi/elf_ia32_fbsd_efi.lds b/gnuefi/elf_ia32_fbsd_efi.lds index 77d6fad..cd309e2 100644 --- a/gnuefi/elf_ia32_fbsd_efi.lds +++ b/gnuefi/elf_ia32_fbsd_efi.lds @@ -5,7 +5,9 @@ SECTIONS { . = 0; ImageBase = .; - .hash : { *(.hash) } /* this MUST come first! */ + /* .hash and/or .gnu.hash MUST come first! */ + .hash : { *(.hash) } + .gnu.hash : { *(.gnu.hash) } . = ALIGN(4096); .text : { diff --git a/gnuefi/elf_ia64_efi.lds b/gnuefi/elf_ia64_efi.lds index baca962..190792a 100644 --- a/gnuefi/elf_ia64_efi.lds +++ b/gnuefi/elf_ia64_efi.lds @@ -5,7 +5,9 @@ SECTIONS { . = 0; ImageBase = .; - .hash : { *(.hash) } /* this MUST come first! */ + /* .hash and/or .gnu.hash MUST come first! */ + .hash : { *(.hash) } + .gnu.hash : { *(.gnu.hash) } . = ALIGN(4096); .text : { diff --git a/gnuefi/elf_x86_64_efi.lds b/gnuefi/elf_x86_64_efi.lds index 942d1f3..7be5902 100644 --- a/gnuefi/elf_x86_64_efi.lds +++ b/gnuefi/elf_x86_64_efi.lds @@ -6,7 +6,9 @@ SECTIONS { . = 0; ImageBase = .; - .hash : { *(.hash) } /* this MUST come first! */ + /* .hash and/or .gnu.hash MUST come first! */ + .hash : { *(.hash) } + .gnu.hash : { *(.gnu.hash) } . = ALIGN(4096); .eh_frame : { diff --git a/gnuefi/elf_x86_64_fbsd_efi.lds b/gnuefi/elf_x86_64_fbsd_efi.lds index 6fd2031..fe1f334 100644 --- a/gnuefi/elf_x86_64_fbsd_efi.lds +++ b/gnuefi/elf_x86_64_fbsd_efi.lds @@ -6,7 +6,9 @@ SECTIONS { . = 0; ImageBase = .; - .hash : { *(.hash) } /* this MUST come first! */ + /* .hash and/or .gnu.hash MUST come first! */ + .hash : { *(.hash) } + .gnu.hash : { *(.gnu.hash) } . = ALIGN(4096); .eh_frame : {