aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2015-08-21 13:43:44 -0400
committerChris Zankel <chris@zankel.net>2015-08-20 11:28:42 -0400
commit895fb3159280fe7695b35ec7c87ec19e13ca5b6e (patch)
tree9f695fddee74fb7ebdba3655559c4dc874e504e8
parent69034db79a8101dccdeb2b909b3aaa52001ab1ef (diff)
xtensa: improve vmlinux.lds.S sed post-processing
Current sed script makes assumptions about the structure of rules that group .text sections in the vmlinux linker script. These assumptions get broken occasionally, e.g.: 779c88c94c34 "ARM: 8321/1: asm-generic: introduce.text.fixup input section", or 9bebe9e5b0f3 "kbuild: Fix .text.unlikely placement". Rewrite sed rules so that they don't depend on number/arrangement of text sections in *(...) blocks. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
-rw-r--r--arch/xtensa/kernel/Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/xtensa/kernel/Makefile b/arch/xtensa/kernel/Makefile
index 547a757e6fa2..50137bc9e150 100644
--- a/arch/xtensa/kernel/Makefile
+++ b/arch/xtensa/kernel/Makefile
@@ -28,10 +28,11 @@ AFLAGS_head.o += -mtext-section-literals
28# 28#
29# Replicate rules in scripts/Makefile.build 29# Replicate rules in scripts/Makefile.build
30 30
31sed-y = -e 's/\*(\(\.[a-z]*it\|\.ref\|\)\.text)/*(\1.literal \1.text)/g' \ 31sed-y = -e ':a; s/\*(\([^)]*\)\.text\.unlikely/*(\1.literal.unlikely .{text}.unlikely/; ta; ' \
32 -e 's/\.text\.unlikely/.literal.unlikely .text.unlikely/g' \ 32 -e ':b; s/\*(\([^)]*\)\.text\(\.[a-z]*\)/*(\1.{text}\2.literal .{text}\2/; tb; ' \
33 -e 's/\*(\(\.text .*\))/*(.literal \1)/g' \ 33 -e ':c; s/\*(\([^)]*\)\(\.[a-z]*it\|\.ref\)\.text/*(\1\2.literal \2.{text}/; tc; ' \
34 -e 's/\*(\(\.text\.[a-z]*\))/*(\1.literal \1)/g' 34 -e ':d; s/\*(\([^)]\+ \|\)\.text/*(\1.literal .{text}/; td; ' \
35 -e 's/\.{text}/.text/g'
35 36
36quiet_cmd__cpp_lds_S = LDS $@ 37quiet_cmd__cpp_lds_S = LDS $@
37cmd__cpp_lds_S = $(CPP) $(cpp_flags) -P -C -Uxtensa -D__ASSEMBLY__ $< \ 38cmd__cpp_lds_S = $(CPP) $(cpp_flags) -P -C -Uxtensa -D__ASSEMBLY__ $< \