[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#609371: linux-image-2.6.37-trunk-sparc64: module scsi_mod: Unknown relocation: 36



Hi,

On 15/01/2011 10:00, Bastian Blank wrote:
On Fri, Jan 14, 2011 at 11:38:28AM -0800, David Miller wrote:
From: Richard Mortimer<richm@oldelvet.org.uk>
So that means that the kernel is complaining about type 54 which is
R_SPARC_UA64. That matches with the objdump output which doesn't list
R_SPARC_LM22 for scsi_mod.ko

Indeed, good catch :-)
That makes things different, I'll look into this, thanks.

If I see this correctly, then _UA64 is the same then _64 except for the
alignment requirements; similar to _UA32 and _32. So this should be
fixed by the following patch.

Yes I was thinking along the same lines. As best I can see the ftrace related use of the R_SPARC_UA64 and R_SPARC_13 relocation types are both valid in the context of -mcode=medlow

diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c
index ee3c7dd..4d55a43 100644
--- a/arch/sparc/kernel/module.c
+++ b/arch/sparc/kernel/module.c
@@ -157,6 +157,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
  		switch (ELF_R_TYPE(rel[i].r_info)&  0xff) {
  #ifdef CONFIG_SPARC64
  		case R_SPARC_64:
+		case R_SPARC_UA64:
  			location[0] = v>>  56;
  			location[1] = v>>  48;
  			location[2] = v>>  40;

I agree with that but we also need to do R_SPARC_13 too. The SPARC compliance definition 2.4
http://www.sparc.com/specificationsDownload.html
lists has both in. I've currently got a compilation running with the following patch in it. I will not be able to test that until this evening UK time.

Of course DaveM may have different ideas on the best way to fix. I'm happy to test any patches that come along.

For completeness I should add that I'm compiling the sources for Debian 2.6.37-1~experimental.1 and not mainline git etc.

Richard

--- module.c.orig       2011-01-15 12:13:34.000000000 +0000
+++ module.c    2011-01-14 18:43:46.000000000 +0000
@@ -157,6 +157,7 @@
                switch (ELF_R_TYPE(rel[i].r_info) & 0xff) {
 #ifdef CONFIG_SPARC64
                case R_SPARC_64:
+               case R_SPARC_UA64:
                        location[0] = v >> 56;
                        location[1] = v >> 48;
                        location[2] = v >> 40;
@@ -206,6 +207,10 @@
                                ((v >> 2) & 0x3fffff);
                        break;

+               case R_SPARC_13:
+                       *loc32 = (*loc32 & ~0x1fff) | (v & 0x1fff);
+                       break;
+
                case R_SPARC_LO10:
                        *loc32 = (*loc32 & ~0x3ff) | (v & 0x3ff);
                        break;




Reply to: