mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-11 07:24:46 +00:00
efi_loader: Move .dynamic out of .text in EFI
EFI applications need to be relocatable. Ordinarily, this is achieved through a PE-format .reloc section, but since that requires toolchain tricks to achieve, U-Boot's EFI applications instead embed ELF-flavored relocation information and use it for self-relocation; thus, the .dynamic section needs to be preserved. Before this patch, it was tacked on to the end of .text, but this was not proper: A .text section is SHT_PROGBITS, while the .dynamic section is SHT_DYNAMIC. Attempting to combine them like this creates a section type mismatch. While GNU ld doesn't seem to complain, LLVM's lld considers this a fatal linking error. This patch moves .dynamic out to its own section, so that the output ELF has the correct types. (They're all mashed together when converting to binary anyway, so this patch causes no change in the final .efi output.) Signed-off-by: Sam Edwards <CFSworks@gmail.com> Cc: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
parent
214a87757a
commit
408a20e099
1 changed files with 3 additions and 3 deletions
|
@ -21,10 +21,10 @@ SECTIONS
|
|||
*(.gnu.linkonce.t.*)
|
||||
*(.srodata)
|
||||
*(.rodata*)
|
||||
. = ALIGN(16);
|
||||
*(.dynamic);
|
||||
. = ALIGN(512);
|
||||
}
|
||||
. = ALIGN(16);
|
||||
.dynamic : { *(.dynamic) }
|
||||
. = ALIGN(512);
|
||||
.rela.dyn : { *(.rela.dyn) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
|
|
Loading…
Add table
Reference in a new issue