sh: Fix up SHmedia module ELF relocations.
authorPaul Mundt <lethal@linux-sh.org>
Sat, 9 May 2009 09:03:37 +0000 (18:03 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Sat, 9 May 2009 09:03:37 +0000 (18:03 +0900)
This fixes up the LSB setting for SHmedia branching in updated symbols
when processing module relocations.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/module.c

index c430810..c19b0f7 100644 (file)
@@ -90,7 +90,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
                 * SHmedia, the LSB of the symbol needs to be asserted
                 * for the CPU to be in SHmedia mode when it starts executing
                 * the branch target. */
-               relocation |= (sym->st_other & 4);
+               relocation |= !!(sym->st_other & 4);
 #endif
 
                switch (ELF32_R_TYPE(rel[i].r_info)) {