summaryrefslogtreecommitdiff
path: root/arch/arm/include
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-03-10 10:24:49 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2009-03-10 10:24:49 +0000
commitb28f1329135cce5f96f600b654dff7c700c3acdd (patch)
tree145779251b14284d2c1ad60b26ab4a7a708355c2 /arch/arm/include
parent5b15fc5636dd877344fcbdff7be22e639e7f43a1 (diff)
Thumb-2: Add support for loadable modules
Modules compiled to Thumb-2 have two additional relocations needing to be resolved at load time, R_ARM_THM_CALL and R_ARM_THM_JUMP24, for BL and B.W instructions. The maximum Thumb-2 addressing range is +/-2^24 (+/-16MB) therefore the MODULES_VADDR macro in asm/memory.h is set to (MODULES_END - 8MB) for the Thumb-2 compiled kernel. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/elf.h3
-rw-r--r--arch/arm/include/asm/memory.h5
2 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h
index def8eac6e89d..e9b66a202e66 100644
--- a/arch/arm/include/asm/elf.h
+++ b/arch/arm/include/asm/elf.h
@@ -52,6 +52,9 @@ typedef struct user_fp elf_fpregset_t;
#define R_ARM_JUMP24 29
#define R_ARM_PREL31 42
+#define R_ARM_THM_JUMP24 30
+#define R_ARM_THM_CALL 10
+
/*
* These are used to set parameters in the core dumps.
*/
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 77764301844b..38aee93772d9 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -45,7 +45,12 @@
* and PAGE_OFFSET - it must be within 32MB of the kernel text.
*/
#define MODULES_END (PAGE_OFFSET)
+#ifndef CONFIG_THUMB2_KERNEL
#define MODULES_VADDR (MODULES_END - 16*1048576)
+#else
+/* smaller range for Thumb-2 symbols relocation (2^24)*/
+#define MODULES_VADDR (MODULES_END - 8*1048576)
+#endif
#if TASK_SIZE > MODULES_VADDR
#error Top of user space clashes with start of module space