]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sandbox: Rename EFI runtime sections
authorAndrew Scull <ascull@google.com>
Mon, 30 May 2022 10:00:02 +0000 (10:00 +0000)
committerTom Rini <trini@konsulko.com>
Thu, 23 Jun 2022 16:58:18 +0000 (12:58 -0400)
Rename the sections used for placing the EFI runtime so that they don't
start with a '.'. ELF says that sections starting with a '.' are
reserved for system use, but the sandbox runs as a normal user process
so should be using user sections instead.

Clang's ASAN adds redzones to non-user sections and the extra padding
meant that the list of options was being corrupted. Naming the sections
as user sections avoids this issue as clang handles them as we intended.

Signed-off-by: Andrew Scull <ascull@google.com>
arch/sandbox/cpu/u-boot.lds
arch/sandbox/lib/sections.c

index 92e834a8d2bc0028082b65f1319f94f1d6a117c1..d2cb12fc298486ba15c8d75a9f1cf935d232a176 100644 (file)
@@ -19,32 +19,30 @@ SECTIONS
                *(.u_boot_sandbox_getopt_end)
        }
 
-       .__efi_runtime_start : {
-               *(.__efi_runtime_start)
+       efi_runtime_start : {
+               *(___efi_runtime_start)
        }
 
-       .efi_runtime : {
+       efi_runtime : {
                *(efi_runtime_text)
                *(efi_runtime_data)
        }
 
-       .__efi_runtime_stop : {
-               *(.__efi_runtime_stop)
+       efi_runtime_stop : {
+               *(___efi_runtime_stop)
        }
 
-       .efi_runtime_rel_start :
-       {
-               *(.__efi_runtime_rel_start)
+       efi_runtime_rel_start : {
+               *(___efi_runtime_rel_start)
        }
 
-       .efi_runtime_rel : {
+       efi_runtime_rel : {
                *(.relefi_runtime_text)
                *(.relefi_runtime_data)
        }
 
-       .efi_runtime_rel_stop :
-       {
-               *(.__efi_runtime_rel_stop)
+       efi_runtime_rel_stop : {
+               *(___efi_runtime_rel_stop)
        }
 
        .dynsym :
index 2559eeea38beca905fec70f5adb92cd9616b007c..2f2f3fbfdb8681e0d29db7e9a6ae0ef127be49d3 100644 (file)
@@ -5,9 +5,9 @@
  */
 #include <linux/compiler.h>
 
-char __efi_runtime_start[0] __section(".__efi_runtime_start");
-char __efi_runtime_stop[0] __section(".__efi_runtime_stop");
+char __efi_runtime_start[0] __section("___efi_runtime_start");
+char __efi_runtime_stop[0] __section("___efi_runtime_stop");
 char __efi_runtime_rel_start[0]
-               __section(".__efi_runtime_rel_start");
+               __section("___efi_runtime_rel_start");
 char __efi_runtime_rel_stop[0]
-               __section(".__efi_runtime_rel_stop");
+               __section("___efi_runtime_rel_stop");