Commit d0b5d9da5de280120b73e776663f6a3024f225f4

Authored by Albert ARIBAUD
1 parent 62bbc2f25a

arm: make _end compiler-generated

This prevents references to _end from generating absolute
relocation records.

This change is binary invariant for ARM targets.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>

Showing 22 changed files with 117 additions and 29 deletions Side-by-side Diff

arch/arm/cpu/arm1136/u-boot-spl.lds
... ... @@ -33,7 +33,11 @@
33 33 .data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
34 34 . = ALIGN(4);
35 35 __image_copy_end = .;
36   - _end = .;
  36 +
  37 + .end :
  38 + {
  39 + *(.__end)
  40 + }
37 41  
38 42 .bss :
39 43 {
arch/arm/cpu/arm920t/ep93xx/u-boot.lds
... ... @@ -50,6 +50,9 @@
50 50 .bss : { *(.bss*) }
51 51 __bss_end = .;
52 52  
53   - _end = .;
  53 + .end :
  54 + {
  55 + *(.__end)
  56 + }
54 57 }
arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
... ... @@ -49,9 +49,14 @@
49 49 __bss_end = .;
50 50 }
51 51  
52   - _end = .;
  52 + .end :
  53 + {
  54 + *(.__end)
  55 + }
53 56  
54   - .dynsym _end : { *(.dynsym) }
  57 + _image_binary_end = .;
  58 +
  59 + .dynsym _image_binary_end : { *(.dynsym) }
55 60 .dynbss : { *(.dynbss) }
56 61 .dynstr : { *(.dynstr*) }
57 62 .dynamic : { *(.dynamic*) }
arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
... ... @@ -49,9 +49,14 @@
49 49 __bss_end = .;
50 50 }
51 51  
52   - _end = .;
  52 + .end :
  53 + {
  54 + *(.__end)
  55 + }
53 56  
54   - .dynsym _end : { *(.dynsym) }
  57 + _image_binary_end = .;
  58 +
  59 + .dynsym _image_binary_end : { *(.dynsym) }
55 60 .dynbss : { *(.dynbss) }
56 61 .dynstr : { *(.dynstr*) }
57 62 .dynamic : { *(.dynamic*) }
arch/arm/cpu/armv7/am33xx/u-boot-spl.lds
... ... @@ -38,7 +38,11 @@
38 38  
39 39 . = ALIGN(4);
40 40 __image_copy_end = .;
41   - _end = .;
  41 +
  42 + .end :
  43 + {
  44 + *(.__end)
  45 + } >.sram
42 46  
43 47 .bss :
44 48 {
arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
... ... @@ -39,7 +39,11 @@
39 39  
40 40 . = ALIGN(4);
41 41 __image_copy_end = .;
42   - _end = .;
  42 +
  43 + .end :
  44 + {
  45 + *(.__end)
  46 + }
43 47  
44 48 .bss :
45 49 {
arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
... ... @@ -28,7 +28,11 @@
28 28  
29 29 . = ALIGN(4);
30 30 __image_copy_end = .;
31   - _end = .;
  31 +
  32 + .end :
  33 + {
  34 + *(.__end)
  35 + }
32 36  
33 37 .bss : {
34 38 . = ALIGN(4);
arch/arm/cpu/armv7/zynq/u-boot.lds
... ... @@ -60,7 +60,12 @@
60 60 *(.__rel_dyn_end)
61 61 }
62 62  
63   - _end = .;
  63 + .end :
  64 + {
  65 + *(.__end)
  66 + }
  67 +
  68 + _image_binary_end = .;
64 69  
65 70 /*
66 71 * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
arch/arm/cpu/at91-common/u-boot-spl.lds
... ... @@ -37,7 +37,11 @@
37 37  
38 38 . = ALIGN(4);
39 39 __image_copy_end = .;
40   - _end = .;
  40 +
  41 + .end :
  42 + {
  43 + *(.__end)
  44 + } >.sram
41 45  
42 46 .bss :
43 47 {
arch/arm/cpu/u-boot-spl.lds
... ... @@ -42,8 +42,13 @@
42 42 __rel_dyn_end = .;
43 43 }
44 44  
45   - _end = .;
  45 + .end :
  46 + {
  47 + *(.__end)
  48 + }
46 49  
  50 + _image_binary_end = .;
  51 +
47 52 .bss __rel_dyn_start (OVERLAY) : {
48 53 __bss_start = .;
49 54 *(.bss*)
... ... @@ -51,7 +56,7 @@
51 56 __bss_end = .;
52 57 }
53 58  
54   - .dynsym _end : { *(.dynsym) }
  59 + .dynsym _image_binary_end : { *(.dynsym) }
55 60 .dynbss : { *(.dynbss) }
56 61 .dynstr : { *(.dynstr*) }
57 62 .dynamic : { *(.dynamic*) }
arch/arm/cpu/u-boot.lds
... ... @@ -60,8 +60,13 @@
60 60 *(.__rel_dyn_end)
61 61 }
62 62  
63   - _end = .;
  63 + .end :
  64 + {
  65 + *(.__end)
  66 + }
64 67  
  68 + _image_binary_end = .;
  69 +
65 70 /*
66 71 * Deprecated: this MMU section is used by pxa at present but
67 72 * should not be used by new boards/CPUs.
... ... @@ -91,7 +96,7 @@
91 96 KEEP(*(.__bss_end));
92 97 }
93 98  
94   - .dynsym _end : { *(.dynsym) }
  99 + .dynsym _image_binary_end : { *(.dynsym) }
95 100 .dynbss : { *(.dynbss) }
96 101 .dynstr : { *(.dynstr*) }
97 102 .dynamic : { *(.dynamic*) }
arch/arm/lib/Makefile
... ... @@ -32,7 +32,6 @@
32 32 ifndef CONFIG_SYS_GENERIC_BOARD
33 33 obj-y += board.o
34 34 endif
35   -obj-y += sections.o
36 35  
37 36 obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
38 37 obj-$(CONFIG_CMD_BOOTM) += bootm.o
... ... @@ -43,6 +42,7 @@
43 42 obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
44 43 endif
45 44  
  45 +obj-y += sections.o
46 46 ifdef CONFIG_ARM64
47 47 obj-y += interrupts_64.o
48 48 else
arch/arm/lib/sections.c
... ... @@ -25,4 +25,5 @@
25 25 char __image_copy_end[0] __attribute__((section(".__image_copy_end")));
26 26 char __rel_dyn_start[0] __attribute__((section(".__rel_dyn_start")));
27 27 char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end")));
  28 +char _end[0] __attribute__((section(".__end")));
board/Barix/ipam390/u-boot-spl-ipam390.lds
... ... @@ -49,6 +49,10 @@
49 49 } >.sram
50 50  
51 51 __image_copy_end = .;
52   - _end = .;
  52 +
  53 + .end :
  54 + {
  55 + *(.__end)
  56 + } >.sram
53 57 }
board/ait/cam_enc_4xx/u-boot-spl.lds
... ... @@ -48,6 +48,10 @@
48 48 } >.sram
49 49  
50 50 __image_copy_end = .;
51   - _end = .;
  51 +
  52 + .end :
  53 + {
  54 + *(.__end)
  55 + }
52 56 }
board/compulab/cm_t335/u-boot.lds
... ... @@ -61,8 +61,13 @@
61 61 *(.__rel_dyn_end)
62 62 }
63 63  
64   - _end = .;
  64 + .end :
  65 + {
  66 + *(.__end)
  67 + }
65 68  
  69 + _image_binary_end = .;
  70 +
66 71 /*
67 72 * Deprecated: this MMU section is used by pxa at present but
68 73 * should not be used by new boards/CPUs.
... ... @@ -92,7 +97,7 @@
92 97 KEEP(*(.__bss_end));
93 98 }
94 99  
95   - .dynsym _end : { *(.dynsym) }
  100 + .dynsym _image_binary_end : { *(.dynsym) }
96 101 .hash : { *(.hash) }
97 102 .got.plt : { *(.got.plt) }
98 103 .dynbss : { *(.dynbss) }
board/davinci/da8xxevm/u-boot-spl-da850evm.lds
... ... @@ -49,6 +49,10 @@
49 49 } >.sram
50 50  
51 51 __image_copy_end = .;
52   - _end = .;
  52 +
  53 + .end :
  54 + {
  55 + *(.__end)
  56 + }
53 57 }
board/davinci/da8xxevm/u-boot-spl-hawk.lds
... ... @@ -61,6 +61,9 @@
61 61 __bss_end = .;
62 62 }
63 63  
64   - _end = .;
  64 + .end :
  65 + {
  66 + *(.__end)
  67 + }
65 68 }
board/freescale/mx31ads/u-boot.lds
... ... @@ -69,8 +69,13 @@
69 69 *(.__rel_dyn_end)
70 70 }
71 71  
72   - _end = .;
  72 + .end :
  73 + {
  74 + *(.__end)
  75 + }
73 76  
  77 + _image_binary_end = .;
  78 +
74 79 /*
75 80 * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
76 81 * __bss_base and __bss_limit are for linker only (overlay ordering)
... ... @@ -90,7 +95,7 @@
90 95 KEEP(*(.__bss_end));
91 96 }
92 97  
93   - .dynsym _end : { *(.dynsym) }
  98 + .dynsym _image_binary_end : { *(.dynsym) }
94 99 .dynbss : { *(.dynbss) }
95 100 .dynstr : { *(.dynstr*) }
96 101 .dynamic : { *(.dynamic*) }
board/samsung/common/exynos-uboot-spl.lds
... ... @@ -42,7 +42,11 @@
42 42 . = ALIGN(4);
43 43  
44 44 __image_copy_end = .;
45   - _end = .;
  45 +
  46 + .end :
  47 + {
  48 + *(.__end)
  49 + } >.sram
46 50  
47 51 .bss :
48 52 {
board/ti/am335x/u-boot.lds
... ... @@ -77,8 +77,13 @@
77 77 *(.__rel_dyn_end)
78 78 }
79 79  
80   - _end = .;
  80 + .end :
  81 + {
  82 + *(.__end)
  83 + }
81 84  
  85 + _image_binary_end = .;
  86 +
82 87 /*
83 88 * Deprecated: this MMU section is used by pxa at present but
84 89 * should not be used by new boards/CPUs.
... ... @@ -108,7 +113,7 @@
108 113 KEEP(*(.__bss_end));
109 114 }
110 115  
111   - .dynsym _end : { *(.dynsym) }
  116 + .dynsym _image_binary_end : { *(.dynsym) }
112 117 .dynbss : { *(.dynbss) }
113 118 .dynstr : { *(.dynstr*) }
114 119 .dynamic : { *(.dynamic*) }
board/vpac270/u-boot-spl.lds
... ... @@ -54,8 +54,13 @@
54 54  
55 55 . = ALIGN(0x800);
56 56  
57   - _end = .;
  57 + .end :
  58 + {
  59 + *(.__end)
  60 + }
58 61  
  62 + _image_binary_end = .;
  63 +
59 64 .bss __rel_dyn_start (OVERLAY) : {
60 65 __bss_start = .;
61 66 *(.bss*)
... ... @@ -63,7 +68,7 @@
63 68 __bss_end = .;
64 69 }
65 70  
66   - .dynsym _end : { *(.dynsym) }
  71 + .dynsym _image_binary_end : { *(.dynsym) }
67 72 .dynbss : { *(.dynbss) }
68 73 .dynstr : { *(.dynstr*) }
69 74 .dynamic : { *(.dynamic*) }