From d0b5d9da5de280120b73e776663f6a3024f225f4 Mon Sep 17 00:00:00 2001 From: Albert ARIBAUD Date: Sat, 22 Feb 2014 17:53:42 +0100 Subject: 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 --- arch/arm/cpu/arm1136/u-boot-spl.lds | 6 +++++- arch/arm/cpu/arm920t/ep93xx/u-boot.lds | 5 ++++- arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds | 9 +++++++-- arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds | 9 +++++++-- arch/arm/cpu/armv7/am33xx/u-boot-spl.lds | 6 +++++- arch/arm/cpu/armv7/omap-common/u-boot-spl.lds | 6 +++++- arch/arm/cpu/armv7/socfpga/u-boot-spl.lds | 6 +++++- arch/arm/cpu/armv7/zynq/u-boot.lds | 7 ++++++- arch/arm/cpu/at91-common/u-boot-spl.lds | 6 +++++- arch/arm/cpu/u-boot-spl.lds | 9 +++++++-- arch/arm/cpu/u-boot.lds | 9 +++++++-- arch/arm/lib/Makefile | 2 +- arch/arm/lib/sections.c | 1 + 13 files changed, 65 insertions(+), 16 deletions(-) (limited to 'arch') diff --git a/arch/arm/cpu/arm1136/u-boot-spl.lds b/arch/arm/cpu/arm1136/u-boot-spl.lds index bccde73..0299902 100644 --- a/arch/arm/cpu/arm1136/u-boot-spl.lds +++ b/arch/arm/cpu/arm1136/u-boot-spl.lds @@ -33,7 +33,11 @@ SECTIONS .data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram . = ALIGN(4); __image_copy_end = .; - _end = .; + + .end : + { + *(.__end) + } .bss : { diff --git a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds index 4bed4fc..9699404 100644 --- a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds +++ b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds @@ -50,5 +50,8 @@ SECTIONS .bss : { *(.bss*) } __bss_end = .; - _end = .; + .end : + { + *(.__end) + } } diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds index 80fb9bd..d0b482d 100644 --- a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds +++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds @@ -49,9 +49,14 @@ SECTIONS __bss_end = .; } - _end = .; + .end : + { + *(.__end) + } + + _image_binary_end = .; - .dynsym _end : { *(.dynsym) } + .dynsym _image_binary_end : { *(.dynsym) } .dynbss : { *(.dynbss) } .dynstr : { *(.dynstr*) } .dynamic : { *(.dynamic*) } diff --git a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds index 76b499d..b6d0f65 100644 --- a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds +++ b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds @@ -49,9 +49,14 @@ SECTIONS __bss_end = .; } - _end = .; + .end : + { + *(.__end) + } + + _image_binary_end = .; - .dynsym _end : { *(.dynsym) } + .dynsym _image_binary_end : { *(.dynsym) } .dynbss : { *(.dynbss) } .dynstr : { *(.dynstr*) } .dynamic : { *(.dynamic*) } diff --git a/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds b/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds index 9302856..b1c28c9 100644 --- a/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds +++ b/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds @@ -38,7 +38,11 @@ SECTIONS . = ALIGN(4); __image_copy_end = .; - _end = .; + + .end : + { + *(.__end) + } >.sram .bss : { diff --git a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds index 02aa129..745603d 100644 --- a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds +++ b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds @@ -39,7 +39,11 @@ SECTIONS . = ALIGN(4); __image_copy_end = .; - _end = .; + + .end : + { + *(.__end) + } .bss : { diff --git a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds index a7c9c9d..4282beb 100644 --- a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds +++ b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds @@ -28,7 +28,11 @@ SECTIONS . = ALIGN(4); __image_copy_end = .; - _end = .; + + .end : + { + *(.__end) + } .bss : { . = ALIGN(4); diff --git a/arch/arm/cpu/armv7/zynq/u-boot.lds b/arch/arm/cpu/armv7/zynq/u-boot.lds index a68b050..f2a5965 100644 --- a/arch/arm/cpu/armv7/zynq/u-boot.lds +++ b/arch/arm/cpu/armv7/zynq/u-boot.lds @@ -60,7 +60,12 @@ SECTIONS *(.__rel_dyn_end) } - _end = .; + .end : + { + *(.__end) + } + + _image_binary_end = .; /* * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c diff --git a/arch/arm/cpu/at91-common/u-boot-spl.lds b/arch/arm/cpu/at91-common/u-boot-spl.lds index 038335d..57ac1eb 100644 --- a/arch/arm/cpu/at91-common/u-boot-spl.lds +++ b/arch/arm/cpu/at91-common/u-boot-spl.lds @@ -37,7 +37,11 @@ SECTIONS . = ALIGN(4); __image_copy_end = .; - _end = .; + + .end : + { + *(.__end) + } >.sram .bss : { diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds index 4880d0f..3e88668 100644 --- a/arch/arm/cpu/u-boot-spl.lds +++ b/arch/arm/cpu/u-boot-spl.lds @@ -42,7 +42,12 @@ SECTIONS __rel_dyn_end = .; } - _end = .; + .end : + { + *(.__end) + } + + _image_binary_end = .; .bss __rel_dyn_start (OVERLAY) : { __bss_start = .; @@ -51,7 +56,7 @@ SECTIONS __bss_end = .; } - .dynsym _end : { *(.dynsym) } + .dynsym _image_binary_end : { *(.dynsym) } .dynbss : { *(.dynbss) } .dynstr : { *(.dynstr*) } .dynamic : { *(.dynamic*) } diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index 4da5d24..87c2de2 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -60,7 +60,12 @@ SECTIONS *(.__rel_dyn_end) } - _end = .; + .end : + { + *(.__end) + } + + _image_binary_end = .; /* * Deprecated: this MMU section is used by pxa at present but @@ -91,7 +96,7 @@ SECTIONS KEEP(*(.__bss_end)); } - .dynsym _end : { *(.dynsym) } + .dynsym _image_binary_end : { *(.dynsym) } .dynbss : { *(.dynbss) } .dynstr : { *(.dynstr*) } .dynamic : { *(.dynamic*) } diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 321997c..45febcf 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -32,7 +32,6 @@ endif ifndef CONFIG_SYS_GENERIC_BOARD obj-y += board.o endif -obj-y += sections.o obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o obj-$(CONFIG_CMD_BOOTM) += bootm.o @@ -43,6 +42,7 @@ else obj-$(CONFIG_SPL_FRAMEWORK) += spl.o endif +obj-y += sections.o ifdef CONFIG_ARM64 obj-y += interrupts_64.o else diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c index e35687c..5b30bcb 100644 --- a/arch/arm/lib/sections.c +++ b/arch/arm/lib/sections.c @@ -25,3 +25,4 @@ char __image_copy_start[0] __attribute__((section(".__image_copy_start"))); char __image_copy_end[0] __attribute__((section(".__image_copy_end"))); char __rel_dyn_start[0] __attribute__((section(".__rel_dyn_start"))); char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end"))); +char _end[0] __attribute__((section(".__end"))); -- cgit v1.1