]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: clean up v7 and v8 linker scripts for __rel_dyn_start/end
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Fri, 15 Mar 2024 06:43:48 +0000 (08:43 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 29 Mar 2024 14:39:25 +0000 (10:39 -0400)
commit 47bd65ef057f ("arm: make __rel_dyn_{start, end} compiler-generated")
were moving the __rel_dyn_start/end on c generated variables that were
injected in their own sections. The reason was that we needed relative
relocations for position independent code and linker bugs back then
prevented us from doing so [0].

However, the linker documentation pages states that symbols that are
defined within a section definition will create a relocatable
type with the value being a fixed offset from the base of a section [1].

[0] binutils commit 6b3b0ab89663 ("Make linker assigned symbol dynamic only for shared object")
[1] https://sourceware.org/binutils/docs/ld/Expression-Section.html

Suggested-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Sam Edwards <CFSworks@gmail.com> # Binary output identical
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
arch/arm/cpu/armv8/u-boot.lds
arch/arm/cpu/u-boot.lds
arch/arm/lib/sections.c
arch/arm/mach-zynq/u-boot.lds

index 8561e1b3142ed927a58058234272d24a38c79081..5ba54dcedf2429dfabbbf11817da0e55e5c4dd07 100644 (file)
@@ -129,20 +129,10 @@ SECTIONS
                *(.__image_copy_end)
        }
 
-       . = ALIGN(8);
-
-       .rel_dyn_start :
-       {
-               *(.__rel_dyn_start)
-       }
-
-       .rela.dyn : {
+       .rela.dyn ALIGN(8) : {
+               __rel_dyn_start = .;
                *(.rela*)
-       }
-
-       .rel_dyn_end :
-       {
-               *(.__rel_dyn_end)
+               __rel_dyn_end = .;
        }
 
        _end = .;
index f19f2812ee916a6f151a94f5b52de7318c957712..0682d34207fad4cc2925d77450add02d8a78d9a1 100644 (file)
@@ -166,18 +166,10 @@ SECTIONS
                *(.__image_copy_end)
        }
 
-       .rel_dyn_start :
-       {
-               *(.__rel_dyn_start)
-       }
-
-       .rel.dyn : {
+       .rel.dyn ALIGN(4) : {
+               __rel_dyn_start = .;
                *(.rel*)
-       }
-
-       .rel_dyn_end :
-       {
-               *(.__rel_dyn_end)
+               __rel_dyn_end = .;
        }
 
        .end :
index ddfde52163fc0ae1fb5085238a0f7561be638ddf..1ee3dd3667bab89f8c6666d78fd5a3331b730032 100644 (file)
@@ -21,8 +21,6 @@
 
 char __image_copy_start[0] __section(".__image_copy_start");
 char __image_copy_end[0] __section(".__image_copy_end");
-char __rel_dyn_start[0] __section(".__rel_dyn_start");
-char __rel_dyn_end[0] __section(".__rel_dyn_end");
 char __secure_start[0] __section(".__secure_start");
 char __secure_end[0] __section(".__secure_end");
 char __secure_stack_start[0] __section(".__secure_stack_start");
index bb0e0ceb32ecb2bc863347c09226276322c4afbd..3b1f0d349356b3de17c4f9220e83c6b5a89e6028 100644 (file)
@@ -71,18 +71,10 @@ SECTIONS
                *(.__image_copy_end)
        }
 
-       .rel_dyn_start :
-       {
-               *(.__rel_dyn_start)
-       }
-
-       .rel.dyn : {
+       .rel.dyn ALIGN(8) : {
+               __rel_dyn_start = .;
                *(.rel*)
-       }
-
-       .rel_dyn_end :
-       {
-               *(.__rel_dyn_end)
+               __rel_dyn_end = .;
        }
 
        .end :