diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2016-09-13 01:50:50 +0200 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2016-09-30 23:48:19 +0200 |
commit | 94f4fb0841bfa5c1088a1b3a879a65bdd675ecd2 (patch) | |
tree | dd237a8e66238f0607ba946b9a3cf65bcbc7e8db /arch/arc/kernel/module.c | |
parent | arc: perf: Enable generic "cache-references" and "cache-misses" events (diff) | |
download | linux-94f4fb0841bfa5c1088a1b3a879a65bdd675ecd2.tar.xz linux-94f4fb0841bfa5c1088a1b3a879a65bdd675ecd2.zip |
ARC: module: support R_ARC_32_PCREL relocation
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/kernel/module.c')
-rw-r--r-- | arch/arc/kernel/module.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arc/kernel/module.c b/arch/arc/kernel/module.c index 376e04622962..576a238434a1 100644 --- a/arch/arc/kernel/module.c +++ b/arch/arc/kernel/module.c @@ -106,10 +106,12 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, */ relo_type = ELF32_R_TYPE(rel_entry[i].r_info); - if (likely(R_ARC_32_ME == relo_type)) + if (likely(R_ARC_32_ME == relo_type)) /* ME ( S + A ) */ arc_write_me((unsigned short *)location, relocation); - else if (R_ARC_32 == relo_type) + else if (R_ARC_32 == relo_type) /* ( S + A ) */ *((Elf32_Addr *) location) = relocation; + else if (R_ARC_32_PCREL == relo_type) /* ( S + A ) - PDATA ) */ + *((Elf32_Addr *) location) = relocation - location; else goto relo_err; |