]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: make .data section of *_efi.so files RW
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 4 Jan 2023 22:43:08 +0000 (23:43 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 6 Jan 2023 21:27:30 +0000 (22:27 +0100)
When building with binutils 2.39 warnings

    *_efi.so has a LOAD segment with RWX permissions

occur.

Use SHF_WRITE | SHF_ALLOC as section flags for the .data section.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
arch/arm/lib/elf_aarch64_efi.lds

index ffc6f6e6045e7c9e55055d11a2138447048e2adf..3e3da47d6a9d17bd7bd5d538b4cd66d3af82c0d9 100644 (file)
@@ -7,6 +7,12 @@
 
 OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
 OUTPUT_ARCH(aarch64)
+
+PHDRS
+{
+       data PT_LOAD FLAGS(3); /* SHF_WRITE | SHF_ALLOC */
+}
+
 ENTRY(_start)
 SECTIONS
 {
@@ -49,7 +55,7 @@ SECTIONS
                . = ALIGN(512);
                _bss_end = .;
                _edata = .;
-       }
+       } :data
        _data_size = _edata - _data;
        .rela.dyn : { *(.rela.dyn) }
        .rela.plt : { *(.rela.plt) }