linux-omap 2.6.29: backport some relocations from .31, this is needed if you are...
authorKoen Kooi <koen@openembedded.org>
Wed, 4 Nov 2009 10:46:36 +0000 (11:46 +0100)
committerKoen Kooi <koen@openembedded.org>
Wed, 4 Nov 2009 10:46:36 +0000 (11:46 +0100)
recipes/linux/linux-omap-2.6.29/2.6.29_relocation_1.patch [new file with mode: 0644]
recipes/linux/linux-omap-2.6.29/2.6.29_relocation_2.patch [new file with mode: 0644]
recipes/linux/linux-omap_2.6.29.bb

diff --git a/recipes/linux/linux-omap-2.6.29/2.6.29_relocation_1.patch b/recipes/linux/linux-omap-2.6.29/2.6.29_relocation_1.patch
new file mode 100644 (file)
index 0000000..627f03c
--- /dev/null
@@ -0,0 +1,11 @@
+--- /tmp/elf.h 2009-11-03 20:29:16.000000000 +0100
++++ git/arch/arm/include/asm/elf.h     2009-11-03 20:29:40.000000000 +0100
+@@ -50,6 +50,8 @@
+ #define R_ARM_ABS32   2
+ #define R_ARM_CALL    28
+ #define R_ARM_JUMP24  29
++#define R_ARM_MOVW_ABS_NC 43
++#define R_ARM_MOVT_ABS 44
+ /*
+  * These are used to set parameters in the core dumps.
diff --git a/recipes/linux/linux-omap-2.6.29/2.6.29_relocation_2.patch b/recipes/linux/linux-omap-2.6.29/2.6.29_relocation_2.patch
new file mode 100644 (file)
index 0000000..caa8dd5
--- /dev/null
@@ -0,0 +1,33 @@
+--- /tmp/module.c      2009-11-03 20:30:56.000000000 +0100
++++ git/arch/arm/kernel/module.c       2009-11-03 20:34:33.000000000 +0100
+@@ -83,6 +83,7 @@
+               unsigned long loc;
+               Elf32_Sym *sym;
+               s32 offset;
++              s32 addend;
+               offset = ELF32_R_SYM(rel->r_info);
+               if (offset < 0 || offset > (symsec->sh_size / sizeof(Elf32_Sym))) {
+@@ -132,6 +133,22 @@
+                       *(u32 *)loc |= offset & 0x00ffffff;
+                       break;
++              case R_ARM_MOVW_ABS_NC:
++              case R_ARM_MOVT_ABS:
++                      offset = sym->st_value;
++
++                      addend = ((*(u32 *)loc >> 4) & 0xf000) | (*(u32 *)loc &0xfff);
++                      addend = (addend ^ 0x8000) - 0x8000;
++                      offset += addend;
++
++                      if (ELF32_R_TYPE(rel->r_info) == R_ARM_MOVT_ABS)
++                              offset >>= 16;
++
++                      *(u32 *)loc &= 0xfff0f000;
++                      *(u32 *)loc |= offset & 0xfff;
++                      *(u32 *)loc |= (offset & 0xf000) << 4;
++                      break;
++
+               default:
+                       printk(KERN_ERR "%s: unknown relocation: %u\n",
+                              module->name, ELF32_R_TYPE(rel->r_info));
index 465d5ad..130f9a8 100644 (file)
@@ -166,6 +166,8 @@ SRC_URI_append = " \
            file://arch-has-holes.diff;patch=1 \
            file://cache/l1cache-shift.patch;patch=1 \
            file://cache/copy-page-tweak.patch;patch=1 \
+           file://2.6.29_relocation_1.patch;patch=1 \
+           file://2.6.29_relocation_2.patch;patch=1 \
 "