Message ID | 20100616192257.GW20317@bombadil.infradead.org |
---|---|
State | RFC |
Delegated to: | David Miller |
Headers | show |
From: Kyle McMartin <kyle@mcmartin.ca> Date: Wed, 16 Jun 2010 15:22:57 -0400 > arch/sparc/kernel/module.c needs to be patched to support the new > relocation type... Based on binutils/gas/config/tc-sparc.c and gold's > sparc config this looks to be the same as the hi22 reloc... > > Can you test the following patch? This change is incorrect. LM22 relocations do not get emitted for the "medlow" code model, which is what is explicitly specified on the kernel compiler command line for sparc64 via "-mcmodel=medlow". Someone this person is using incorrect CFLAGS when building their module, and that's why they have this problem, because the compiler's default code model on sparc64 can generate those relocations. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Jun 16, 2010 at 01:38:54PM -0700, David Miller wrote: > This change is incorrect. > > LM22 relocations do not get emitted for the "medlow" code model, which > is what is explicitly specified on the kernel compiler command line > for sparc64 via "-mcmodel=medlow". > > Someone this person is using incorrect CFLAGS when building their > module, and that's why they have this problem, because the compiler's > default code model on sparc64 can generate those relocations. > Yeah, just saw your other mail. Thanks for the explanation! --Kyle -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/arch/sparc/include/asm/elf_64.h b/arch/sparc/include/asm/elf_64.h index e678803..8bf59f1 100644 --- a/arch/sparc/include/asm/elf_64.h +++ b/arch/sparc/include/asm/elf_64.h @@ -52,6 +52,7 @@ #define R_SPARC_11 31 #define R_SPARC_64 32 #define R_SPARC_OLO10 33 +#define R_SPARC_LM22 36 #define R_SPARC_WDISP16 40 #define R_SPARC_WDISP19 41 #define R_SPARC_7 43 diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c index f848aad..49b1b21 100644 --- a/arch/sparc/kernel/module.c +++ b/arch/sparc/kernel/module.c @@ -207,6 +207,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, *loc32 = (*loc32 & ~0x3ff) | (v & 0x3ff); break; + case R_SPARC_LM22: case R_SPARC_HI22: *loc32 = (*loc32 & ~0x3fffff) | ((v >> 10) & 0x3fffff);