aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic-2.6
diff options
context:
space:
mode:
authorMirko Vogt <mirko@openwrt.org>2009-04-10 18:47:05 +0000
committerMirko Vogt <mirko@openwrt.org>2009-04-10 18:47:05 +0000
commit91c9d999e839309ff3db1f7d1d51c5e7dcb66bb5 (patch)
treea00ab7dca4d92d87c8e8d790649ecaaaf5c09f7f /target/linux/generic-2.6
parente09e931b55735c0094efe8c200246d1f697357bf (diff)
downloadupstream-91c9d999e839309ff3db1f7d1d51c5e7dcb66bb5.tar.gz
upstream-91c9d999e839309ff3db1f7d1d51c5e7dcb66bb5.tar.bz2
upstream-91c9d999e839309ff3db1f7d1d51c5e7dcb66bb5.zip
add the R_ARM_V4BX relocation to the ARM kernel module loader
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15208 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic-2.6')
-rw-r--r--target/linux/generic-2.6/patches-2.6.28/230-add-r_arm_v4bx-relocation-for-arm-module-loader.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/target/linux/generic-2.6/patches-2.6.28/230-add-r_arm_v4bx-relocation-for-arm-module-loader.patch b/target/linux/generic-2.6/patches-2.6.28/230-add-r_arm_v4bx-relocation-for-arm-module-loader.patch
new file mode 100644
index 0000000000..3fac7aba43
--- /dev/null
+++ b/target/linux/generic-2.6/patches-2.6.28/230-add-r_arm_v4bx-relocation-for-arm-module-loader.patch
@@ -0,0 +1,33 @@
+diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h
+index a58378c..ce3b36e 100644
+--- a/arch/arm/include/asm/elf.h
++++ b/arch/arm/include/asm/elf.h
+@@ -50,6 +50,7 @@ typedef struct user_fp elf_fpregset_t;
+ #define R_ARM_ABS32 2
+ #define R_ARM_CALL 28
+ #define R_ARM_JUMP24 29
++#define R_ARM_V4BX 40
+
+ /*
+ * These are used to set parameters in the core dumps.
+diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
+index dab48f2..9f509fd 100644
+--- a/arch/arm/kernel/module.c
++++ b/arch/arm/kernel/module.c
+@@ -132,6 +132,15 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
+ *(u32 *)loc |= offset & 0x00ffffff;
+ break;
+
++ case R_ARM_V4BX:
++ /* Preserve Rm and the condition code. Alter
++ * other bits to re-code instruction as
++ * MOV PC,Rm.
++ */
++ *(u32 *)loc &= 0xf000000f;
++ *(u32 *)loc |= 0x01a0f000;
++ break;
++
+ default:
+ printk(KERN_ERR "%s: unknown relocation: %u\n",
+ module->name, ELF32_R_TYPE(rel->r_info));
+