diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2017-03-14 11:47:29 -0400 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2017-03-15 15:55:30 -0400 |
commit | 5f655322b1ba4bd46e26e307d04098f9c84df764 (patch) | |
tree | 049f36f71b491a29a24f409ceebb634e93408971 | |
parent | 95422dec6bd4a7c57444743f7b1bb375335a6298 (diff) |
parisc: support R_PARISC_SECREL32 relocation in modules
The parisc kernel doesn't work with CONFIG_MODVERSIONS since the commit
71810db27c1c853b335675bee335d893bc3d324b. It can't load modules with the
error: "module unix: Unknown relocation: 41".
The commit changes __kcrctab from 64-bit valus to 32-bit values. The
assembler generates R_PARISC_SECREL32 secrel relocation for them and the
module loader doesn't support this relocation.
This patch adds the R_PARISC_SECREL32 relocation to the module loader.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org # v4.10+
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r-- | arch/parisc/kernel/module.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index a0ecdb4abcc8..c66c943d9322 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c | |||
@@ -620,6 +620,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs, | |||
620 | */ | 620 | */ |
621 | *loc = fsel(val, addend); | 621 | *loc = fsel(val, addend); |
622 | break; | 622 | break; |
623 | case R_PARISC_SECREL32: | ||
624 | /* 32-bit section relative address. */ | ||
625 | *loc = fsel(val, addend); | ||
626 | break; | ||
623 | case R_PARISC_DPREL21L: | 627 | case R_PARISC_DPREL21L: |
624 | /* left 21 bit of relative address */ | 628 | /* left 21 bit of relative address */ |
625 | val = lrsel(val - dp, addend); | 629 | val = lrsel(val - dp, addend); |
@@ -807,6 +811,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs, | |||
807 | */ | 811 | */ |
808 | *loc = fsel(val, addend); | 812 | *loc = fsel(val, addend); |
809 | break; | 813 | break; |
814 | case R_PARISC_SECREL32: | ||
815 | /* 32-bit section relative address. */ | ||
816 | *loc = fsel(val, addend); | ||
817 | break; | ||
810 | case R_PARISC_FPTR64: | 818 | case R_PARISC_FPTR64: |
811 | /* 64-bit function address */ | 819 | /* 64-bit function address */ |
812 | if(in_local(me, (void *)(val + addend))) { | 820 | if(in_local(me, (void *)(val + addend))) { |