From fd99b50bd843b13a6f04ed28185988c4ac79b186 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Wed, 27 Apr 2011 14:54:39 -0400 Subject: [PATCH] --- yaml --- r: 249983 b: refs/heads/master c: 8d7e4cc2c8ea1d180d32d902eb899f27d3ee53d7 h: refs/heads/master i: 249981: 55e8ffedd88f955ec9189695a69a3c46f49de73c 249979: 58fc5597abaa3aeeda39c33b90ea9e3359b27cae 249975: d245288b53bde863aedf182735aa0b3aa6fd2d25 249967: c44213b86387076cb8aadd06ae1764368eaa3f91 249951: 31917011d3448200fb63d49d2e0b4e74c662eeb0 249919: 3281c166dc71198f61529514027177dabbdeac0c 249855: 097017c37626a2f13eefdb3620986e715018c5cb v: v3 --- [refs] | 2 +- trunk/arch/arm/boot/compressed/Makefile | 15 ++++++++++++++- trunk/arch/arm/boot/compressed/head.S | 6 +++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 69514340fac1..35fad979d14f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8ea0de4b8831513924e3ec6a17bb721fabf97055 +refs/heads/master: 8d7e4cc2c8ea1d180d32d902eb899f27d3ee53d7 diff --git a/trunk/arch/arm/boot/compressed/Makefile b/trunk/arch/arm/boot/compressed/Makefile index 79b5c62746df..23aad0722303 100644 --- a/trunk/arch/arm/boot/compressed/Makefile +++ b/trunk/arch/arm/boot/compressed/Makefile @@ -120,10 +120,23 @@ lib1funcs = $(obj)/lib1funcs.o $(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE $(call cmd,shipped) +# We need to prevent any GOTOFF relocs being used with references +# to symbols in the .bss section since we cannot relocate them +# independently from the rest at run time. This can be achieved by +# ensuring that no private .bss symbols exist, as global symbols +# always have a GOT entry which is what we need. +# The .data section is already discarded by the linker script so no need +# to bother about it here. +check_for_bad_syms = \ +bad_syms=$$($(CROSS_COMPILE)nm $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \ +[ -z "$$bad_syms" ] || \ + ( echo "following symbols must have non local/private scope:" >&2; \ + echo "$$bad_syms" >&2; rm -f $@; false ) + $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE $(call if_changed,ld) - @: + @$(check_for_bad_syms) $(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE $(call if_changed,$(suffix_y)) diff --git a/trunk/arch/arm/boot/compressed/head.S b/trunk/arch/arm/boot/compressed/head.S index b541217bd040..8d5d91aefbb9 100644 --- a/trunk/arch/arm/boot/compressed/head.S +++ b/trunk/arch/arm/boot/compressed/head.S @@ -372,7 +372,7 @@ LC0: .word LC0 @ r1 .word input_data_end - 4 @ r10 (inflated size location) .word _got_start @ r11 .word _got_end @ ip - .word user_stack_end @ sp + .word .L_user_stack_end @ sp .size LC0, . - LC0 #ifdef CONFIG_ARCH_RPC @@ -1100,5 +1100,5 @@ reloc_code_end: .align .section ".stack", "aw", %nobits -user_stack: .space 4096 -user_stack_end: +.L_user_stack: .space 4096 +.L_user_stack_end: