Browse Source

parisc: Handle R_PARISC_PCREL32 relocations in kernel modules

Commit 0de7985 (parisc: Use generic extable search and sort routines)
changed the exception tables to use 32bit relative offsets.

This patch now adds support to the kernel module loader to handle such
R_PARISC_PCREL32 relocations for 32- and 64-bit modules.

Signed-off-by: Helge Deller <deller@gmx.de>
Helge Deller 9 years ago
parent
commit
592570c950
1 changed files with 8 additions and 0 deletions
  1. 8 0
      arch/parisc/kernel/module.c

+ 8 - 0
arch/parisc/kernel/module.c

@@ -660,6 +660,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
 			}
 			}
 			*loc = (*loc & ~0x3ff1ffd) | reassemble_22(val);
 			*loc = (*loc & ~0x3ff1ffd) | reassemble_22(val);
 			break;
 			break;
+		case R_PARISC_PCREL32:
+			/* 32-bit PC relative address */
+			*loc = val - dot - 8 + addend;
+			break;
 
 
 		default:
 		default:
 			printk(KERN_ERR "module %s: Unknown relocation: %u\n",
 			printk(KERN_ERR "module %s: Unknown relocation: %u\n",
@@ -788,6 +792,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
 			CHECK_RELOC(val, 22);
 			CHECK_RELOC(val, 22);
 			*loc = (*loc & ~0x3ff1ffd) | reassemble_22(val);
 			*loc = (*loc & ~0x3ff1ffd) | reassemble_22(val);
 			break;
 			break;
+		case R_PARISC_PCREL32:
+			/* 32-bit PC relative address */
+			*loc = val - dot - 8 + addend;
+			break;
 		case R_PARISC_DIR64:
 		case R_PARISC_DIR64:
 			/* 64-bit effective address */
 			/* 64-bit effective address */
 			*loc64 = val + addend;
 			*loc64 = val + addend;