Skip to contentSkip to conversation

parisc: Handle R_PARISC_PCREL32 relocation in kernel modules

PATCH New Helge Deller 1 participant 1 message Apr 8, 2016 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 parisc: Handle R_PARISC_PCREL32 relocation in kernel modules

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

With that change, the kernel needs to handle R_PARISC_PCREL32 relocations which this patch adds.

arch/parisc/kernel/module.c +4 -0
index b9d75d9..c54cf39 100644
@@ -788,6 +788,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
 			CHECK_RELOC(val, 22);
 			*loc = (*loc & ~0x3ff1ffd) | reassemble_22(val);
 			break;
+		case R_PARISC_PCREL32:
+			/* 32-bit PC relative address */
+			*loc = val - dot - 8 + addend;
+			break;
 		case R_PARISC_DIR64:
 			/* 64-bit effective address */
 			*loc64 = val + addend;