diff options
author | Jon Medhurst <tixy@linaro.org> | 2014-09-30 10:25:10 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-09-30 16:55:24 +0100 |
commit | ad684dce87fac52738649e62b4afa25081b52a28 (patch) | |
tree | 42b37e2d471f9cdecc61018217cb4ad771f63149 /arch/arm/kernel/kprobes-test.h | |
parent | 9cc6d9e5daaa147a9a3e31557efcb331989e77be (diff) | |
download | blackbird-op-linux-ad684dce87fac52738649e62b4afa25081b52a28.tar.gz blackbird-op-linux-ad684dce87fac52738649e62b4afa25081b52a28.zip |
ARM: 8179/1: kprobes-test: Fix compile error "bad immediate value for offset"
When compiling kprobes-test-arm.c the following error has been observed
/tmp/ccoT403o.s:21439: Error: bad immediate value for offset (4168)
This is caused by the compiler spilling it's literal pool too far away
from the site which is trying to reference it with a PC relative load.
This arises because the compiler is underestimating the size of the
inline assembler code present, which apparently it approximates as 4
bytes per line or instruction.
We fix this problem by moving the operations which generate more than
4 bytes out of the text section. Specifically, moving the .ascii
directives to the .rodata section.
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/kprobes-test.h')
-rw-r--r-- | arch/arm/kernel/kprobes-test.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/kernel/kprobes-test.h b/arch/arm/kernel/kprobes-test.h index eecc90a0fd91..4430990e90e7 100644 --- a/arch/arm/kernel/kprobes-test.h +++ b/arch/arm/kernel/kprobes-test.h @@ -111,11 +111,14 @@ struct test_arg_end { #define TESTCASE_START(title) \ __asm__ __volatile__ ( \ "bl __kprobes_test_case_start \n\t" \ + ".pushsection .rodata \n\t" \ + "10: \n\t" \ /* don't use .asciz here as 'title' may be */ \ /* multiple strings to be concatenated. */ \ ".ascii "#title" \n\t" \ ".byte 0 \n\t" \ - ".align 2, 0 \n\t" + ".popsection \n\t" \ + ".word 10b \n\t" #define TEST_ARG_REG(reg, val) \ ".byte "__stringify(ARG_TYPE_REG)" \n\t" \ |