Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:gmbr3:Active
fwupd-efi2
aarch64-system.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File aarch64-system.patch of Package fwupd-efi2
From c3bffc83404912d32ea33f38d7d0938fab70f176 Mon Sep 17 00:00:00 2001 From: Callum Farmer <gmbr3@opensuse.org> Date: Mon, 1 Apr 2024 14:48:04 +0100 Subject: [PATCH] Ship an objcopy capable LDS for ARM64 - Local LDS requires not using objcopy and system crt0 Signed-off-by: Callum Farmer <gmbr3@opensuse.org> --- efi/lds/elf_aarch64_efi_system.lds | 153 +++++++++++++++++++++++++++++ efi/meson.build | 8 ++ 2 files changed, 161 insertions(+) create mode 100644 efi/lds/elf_aarch64_efi_system.lds diff --git a/efi/lds/elf_aarch64_efi_system.lds b/efi/lds/elf_aarch64_efi_system.lds new file mode 100644 index 0000000..81de238 --- /dev/null +++ b/efi/lds/elf_aarch64_efi_system.lds @@ -0,0 +1,153 @@ +OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64") +OUTPUT_ARCH(aarch64) +ENTRY(_start) +SECTIONS +{ + . = 0; + ImageBase = .; + /* .hash and/or .gnu.hash MUST come first! */ + .hash : { *(.hash) } + .gnu.hash : { *(.gnu.hash) } + . = ALIGN(4096); + .eh_frame : { *(.eh_frame) } + .gcc_except_table : { *(.gcc_except_table*) } + . = ALIGN(4096); + .text : { + _text = .; + *(.text) + *(.text.*) + *(.gnu.linkonce.t.*) + *(.plt) + . = ALIGN(16); + _etext = .; + } + _text_size = _etext - _text; + . = ALIGN(65536); + _reloc = .; + .reloc : { + *(.reloc) + _ereloc = .; + } + _reloc_size = _ereloc - _reloc; + . = ALIGN(4096); + _data = .; + .dynamic : { *(.dynamic) } + . = ALIGN(4096); + .data : + { + *(.sdata) + *(.data) + *(.data1) + *(.data.*) + *(.got.plt) + *(.got) + + /* + * Note that these aren't the using the GNU "CONSTRUCTOR" output section + * command, so they don't start with a size. Because of p2align and the + * end/END definitions, and the fact that they're mergeable, they can also + * have NULLs which aren't guaranteed to be at the end. + */ + . = ALIGN(16); + __init_array_start = .; + *(SORT(.init_array.*)) + *(.init_array) + __init_array_end = .; + . = ALIGN(16); + __CTOR_LIST__ = .; + *(SORT(.ctors.*)) + *(.ctors) + __CTOR_END__ = .; + . = ALIGN(16); + __DTOR_LIST__ = .; + *(SORT(.dtors.*)) + *(.dtors) + __DTOR_END__ = .; + . = ALIGN(16); + __fini_array_start = .; + *(SORT(.fini_array.*)) + *(.fini_array) + __fini_array_end = .; + + /* the EFI loader doesn't seem to like a .bss section, so we stick + it all into .data: */ + . = ALIGN(16); + _bss = .; + *(.sbss) + *(.scommon) + *(.dynbss) + *(.bss) + *(.bss.*) + *(COMMON) + . = ALIGN(16); + _bss_end = .; + _edata = .; + } + _data_size = _edata - _data; + + . = ALIGN(4096); + _rodata = .; + .rela : + { + *(.rela.text*) + *(.rela.data*) + *(.rela.got) + *(.rela.dyn) + *(.rela.stab) + *(.rela.init_array*) + *(.rela.fini_array*) + *(.rela.ctors*) + *(.rela.dtors*) + + } + . = ALIGN(4096); + .rela.plt : { *(.rela.plt) } + . = ALIGN(4096); + .rodata : { + *(.rodata*) + _erodata = .; + } + _rodata_size = _erodata - _rodata; + /* + * Note that _sbat must be the beginning of the data, and _esbat must be the + * end and must be before any section padding. The sbat self-check uses + * _esbat to find the bounds of the data, and if the padding is included, the + * CSV parser (correctly) rejects the data as having NUL values in one of the + * required columns. + */ + . = ALIGN(4096); + .sbat : + { + _sbat = .; + *(.sbat) + *(.sbat.*) + _esbat = .; + . = ALIGN(4096); + _epsbat = .; + } + _sbat_size = _epsbat - _sbat; + _sbat_vsize = _esbat - _sbat; + . = ALIGN(4096); + .sbom : + { + _sbom = .; + *(.sbom) + _epsbom = .; + } + _sbom_size = _epsbom - _sbom; + _image_end = .; + _alldata_size = _image_end - _reloc; + + . = ALIGN(4096); + .dynsym : { *(.dynsym) } + . = ALIGN(4096); + .dynstr : { *(.dynstr) } + . = ALIGN(4096); + .note.gnu.build-id : { *(.note.gnu.build-id) } + /DISCARD/ : + { + *(.rela.reloc) + *(.note.GNU-stack) + } + .comment 0 : { *(.comment) } +} diff --git a/efi/meson.build b/efi/meson.build index 06abb48..79e09c4 100644 --- a/efi/meson.build +++ b/efi/meson.build @@ -149,6 +149,14 @@ if objcopy_manualsymbols endif endif +# Check aligned lds and crt0 on ARM64 this breaks otherwise +if host_cpu == 'aarch64' and not objcopy_manualsymbols + if efi_ldsdir = join_paths(meson.current_source_dir(), 'lds') + arch_lds = 'elf_@0@@1@_efi_system.lds'.format(gnu_efi_arch, lds_os) + endif +endif + + message('efi-libdir: "@0@"'.format(efi_libdir)) message('efi-ldsdir: "@0@"'.format(efi_ldsdir)) message('efi-crtdir: "@0@"'.format(efi_crtdir))
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor