linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] alpha: module xxx: Unknown relocation: 1
       [not found]       ` <20170411215716.GA29795@gherkin.frus.com>
@ 2017-04-12  2:59         ` Bob Tracy
  2017-04-12  5:57           ` Helge Deller
  0 siblings, 1 reply; 4+ messages in thread
From: Bob Tracy @ 2017-04-12  2:59 UTC (permalink / raw)
  To: Michael Cree, debian-alpha; +Cc: linux-kernel

(Adding linux-kernel to the distribution.  The issue seems to be
architecture-specific, but I'm trying to understand what broke.)

The 4.10-rc1 patch set made fairly extensive modifications to
"a/kernel/module.c" (I'm leaving the "a" there so there's no doubt I
mean the top-level "kernel/module.c" file and not any of the
architecture-specific ones).

One of the changes was to replace an include of <asm/uaccess.h> with
<linux/uaccess.h>.  This is potentially significant because of the
mod we made to alpha's <asm/uaccess.h> to fix the BRSGP relocation
error on __copy_user() issue.

Bottom line is, no kernel I've built since 4.9 can load a module.  All
attempts to load a module result in the error message emitted by
"arch/alpha/kernel/module.c" as follows:

module XXX: Unknown relocation: 1

I'll start attempting to revert the recent module patches to see if that
helps.  If anyone reading this knows what's happening, feel free to
weigh-in before I spend too much time rebuilding kernels on a slow
machine.

--Bob

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] alpha: module xxx: Unknown relocation: 1
  2017-04-12  2:59         ` [BUG] alpha: module xxx: Unknown relocation: 1 Bob Tracy
@ 2017-04-12  5:57           ` Helge Deller
  2017-04-12  7:36             ` Michael Cree
  0 siblings, 1 reply; 4+ messages in thread
From: Helge Deller @ 2017-04-12  5:57 UTC (permalink / raw)
  To: Bob Tracy, Michael Cree, debian-alpha; +Cc: linux-kernel

On 12.04.2017 04:59, Bob Tracy wrote:
> (Adding linux-kernel to the distribution.  The issue seems to be
> architecture-specific, but I'm trying to understand what broke.)
> 
> The 4.10-rc1 patch set made fairly extensive modifications to
> "a/kernel/module.c" (I'm leaving the "a" there so there's no doubt I
> mean the top-level "kernel/module.c" file and not any of the
> architecture-specific ones).
> 
> One of the changes was to replace an include of <asm/uaccess.h> with
> <linux/uaccess.h>.  This is potentially significant because of the
> mod we made to alpha's <asm/uaccess.h> to fix the BRSGP relocation
> error on __copy_user() issue.
> 
> Bottom line is, no kernel I've built since 4.9 can load a module.  All
> attempts to load a module result in the error message emitted by
> "arch/alpha/kernel/module.c" as follows:
> 
> module XXX: Unknown relocation: 1
> 
> I'll start attempting to revert the recent module patches to see if that
> helps.  If anyone reading this knows what's happening, feel free to
> weigh-in before I spend too much time rebuilding kernels on a slow
> machine.

I assume it's due this commmit "modversions: treat symbol CRCs as 32 bit quantities":
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=71810db27c1c853b335675bee335d893bc3d324b

For parisc this patch solves it:
parisc: support R_PARISC_SECREL32 relocation in modules
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5f655322b1ba4bd46e26e307d04098f9c84df764

> module XXX: Unknown relocation: 1

For alpha it seems you need to add similar code to handle R_ALPHA_REFLONG
to apply_relocate_add() in arch/alpha/kernel/module.c

Helge

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] alpha: module xxx: Unknown relocation: 1
  2017-04-12  5:57           ` Helge Deller
@ 2017-04-12  7:36             ` Michael Cree
  2017-04-13  3:46               ` Bob Tracy
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Cree @ 2017-04-12  7:36 UTC (permalink / raw)
  To: Helge Deller; +Cc: Bob Tracy, debian-alpha, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]

On Wed, Apr 12, 2017 at 07:57:52AM +0200, Helge Deller wrote:
> On 12.04.2017 04:59, Bob Tracy wrote:
> > Bottom line is, no kernel I've built since 4.9 can load a module.  All
> > attempts to load a module result in the error message emitted by
> > "arch/alpha/kernel/module.c" as follows:
> > 
> > module XXX: Unknown relocation: 1
> > 
> 
> I assume it's due this commmit "modversions: treat symbol CRCs as 32 bit quantities":
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=71810db27c1c853b335675bee335d893bc3d324b
> 
> For parisc this patch solves it:
> parisc: support R_PARISC_SECREL32 relocation in modules
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5f655322b1ba4bd46e26e307d04098f9c84df764
> 
> > module XXX: Unknown relocation: 1
> 
> For alpha it seems you need to add similar code to handle R_ALPHA_REFLONG
> to apply_relocate_add() in arch/alpha/kernel/module.c

Would the attached patch fix it?  Untested because I don't see the
above issue.

Cheers
Michael.

[-- Attachment #2: alpha-fix-missing-reflong.patch --]
[-- Type: text/x-diff, Size: 486 bytes --]

diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c
index 936bc8f89a67..47632fa8c24e 100644
--- a/arch/alpha/kernel/module.c
+++ b/arch/alpha/kernel/module.c
@@ -181,6 +181,9 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
 		switch (r_type) {
 		case R_ALPHA_NONE:
 			break;
+		case R_ALPHA_REFLONG:
+			*(u32 *)location = value;
+			break;
 		case R_ALPHA_REFQUAD:
 			/* BUG() can produce misaligned relocations. */
 			((u32 *)location)[0] = value;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [BUG] alpha: module xxx: Unknown relocation: 1
  2017-04-12  7:36             ` Michael Cree
@ 2017-04-13  3:46               ` Bob Tracy
  0 siblings, 0 replies; 4+ messages in thread
From: Bob Tracy @ 2017-04-13  3:46 UTC (permalink / raw)
  To: Michael Cree, Helge Deller, debian-alpha, linux-kernel

On Wed, Apr 12, 2017 at 07:36:36PM +1200, Michael Cree wrote:
> On Wed, Apr 12, 2017 at 07:57:52AM +0200, Helge Deller wrote:
> > On 12.04.2017 04:59, Bob Tracy wrote:
> > > Bottom line is, no kernel I've built since 4.9 can load a module.  All
> > > attempts to load a module result in the error message emitted by
> > > "arch/alpha/kernel/module.c" as follows:
> > > 
> > > module XXX: Unknown relocation: 1
> > 
> > I assume it's due this commmit "modversions: treat symbol CRCs as 32 bit quantities":
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=71810db27c1c853b335675bee335d893bc3d324b
> > 
> > For parisc this patch solves it:
> > parisc: support R_PARISC_SECREL32 relocation in modules
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5f655322b1ba4bd46e26e307d04098f9c84df764
> > 
> > > module XXX: Unknown relocation: 1
> > 
> > For alpha it seems you need to add similar code to handle R_ALPHA_REFLONG
> > to apply_relocate_add() in arch/alpha/kernel/module.c
> 
> Would the attached patch fix it?  Untested because I don't see the
> above issue.

I'm up and running on 4.11.0-rc6.  The patch works.  Feel free to add me
as the "Tested-by".  Much appreciated!

--Bob

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-13  3:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20170410004755.GA22356@gherkin.frus.com>
     [not found] ` <20170410094250.gxcne7imso4u2vjx@tower>
     [not found]   ` <20170411034242.GA27395@gherkin.frus.com>
     [not found]     ` <20170411061232.bchlfc73lqx2z2cy@tower>
     [not found]       ` <20170411215716.GA29795@gherkin.frus.com>
2017-04-12  2:59         ` [BUG] alpha: module xxx: Unknown relocation: 1 Bob Tracy
2017-04-12  5:57           ` Helge Deller
2017-04-12  7:36             ` Michael Cree
2017-04-13  3:46               ` Bob Tracy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).