diff options
author | Taras Kondratiuk <taras.kondratiuk@linaro.org> | 2013-11-08 13:29:29 -0500 |
---|---|---|
committer | Taras Kondratiuk <taras@ti.com> | 2014-04-01 09:48:27 -0400 |
commit | 41b5368f31f86a1c2be2bb16a1cf18d23f1223d4 (patch) | |
tree | 19bb9fd519dba304852611c94aa2aedb288309ba /arch/arm/kernel | |
parent | 3b86ee7a691def5dafef46a21ef4fc581f18d74c (diff) |
ARM: kprobes-test: Workaround GAS .align bug
By default if no fill symbol is given to .align directive in a code
section it fills gap with NOPs. If previous fragment is not
instruction-aligned, additional pre-alignment is done by zero bytes
before NOPs. These zero bytes are marked as data by special symbol $d in
symbol table. Unfortunately GAS assumes that there is only code in the
code section so it "puts back" code symbol $a at the end of this
pre-alignment. So if there is some data after alignment it will be
interpreted as code and will be swapped back to LE for BE8 system during
a final linking.
If explicit fill value is given to .align, the NOP-padding code is
skipped and symbol table does not get messed-up.
So the workaround for this issue:
Use explicit fill value if data should be aligned in the code section.
Acked-by: Ben Dooks <ben.dooks@codethink.co.uk>
Acked-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/kprobes-test.c | 2 | ||||
-rw-r--r-- | arch/arm/kernel/kprobes-test.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c index 6e60a349aed9..379639998d5a 100644 --- a/arch/arm/kernel/kprobes-test.c +++ b/arch/arm/kernel/kprobes-test.c | |||
@@ -113,7 +113,7 @@ | |||
113 | * @ start of inline data... | 113 | * @ start of inline data... |
114 | * .ascii "mov r0, r7" @ text title for test case | 114 | * .ascii "mov r0, r7" @ text title for test case |
115 | * .byte 0 | 115 | * .byte 0 |
116 | * .align 2 | 116 | * .align 2, 0 |
117 | * | 117 | * |
118 | * @ TEST_ARG_REG | 118 | * @ TEST_ARG_REG |
119 | * .byte ARG_TYPE_REG | 119 | * .byte ARG_TYPE_REG |
diff --git a/arch/arm/kernel/kprobes-test.h b/arch/arm/kernel/kprobes-test.h index e28a869b1ae4..eecc90a0fd91 100644 --- a/arch/arm/kernel/kprobes-test.h +++ b/arch/arm/kernel/kprobes-test.h | |||
@@ -115,7 +115,7 @@ struct test_arg_end { | |||
115 | /* multiple strings to be concatenated. */ \ | 115 | /* multiple strings to be concatenated. */ \ |
116 | ".ascii "#title" \n\t" \ | 116 | ".ascii "#title" \n\t" \ |
117 | ".byte 0 \n\t" \ | 117 | ".byte 0 \n\t" \ |
118 | ".align 2 \n\t" | 118 | ".align 2, 0 \n\t" |
119 | 119 | ||
120 | #define TEST_ARG_REG(reg, val) \ | 120 | #define TEST_ARG_REG(reg, val) \ |
121 | ".byte "__stringify(ARG_TYPE_REG)" \n\t" \ | 121 | ".byte "__stringify(ARG_TYPE_REG)" \n\t" \ |