Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: michal at ellpspace.math.ualberta.ca (Michal Jaegermann)
Subject: Odp: Re: AlphaCore 2.0 vs. AlphaServer 4100
Date: Fri, 24 Mar 2006 16:46:28 -0700	[thread overview]
Message-ID: <20060324234628.GA27636@ellpspace.math.ualberta.ca> (raw)
In-Reply-To: <20060324182724.A15803@linux04.mro.cpqcorp.net>

On Fri, Mar 24, 2006 at 06:27:24PM -0500, Jay Estabrook wrote:
> On Fri, Mar 24, 2006 at 04:19:39PM -0700, Michal Jaegermann wrote:
> 
> > Another old change which could be relevant was also for kernel/module.c
> > but if you see there the following comment:
> > 
> >      /* Skip relocations on non-allocated (ie. debug) sections */
> 
> This one is NOT in there.

In that case here is an attached a _really_ old posting from Rusty
Russell.  I cannot tell now if still applicable.

   Michal
-------------- next part --------------
Date: Tue, 30 Dec 2003 14:57:36 +1100
From: Rusty Russell <rusty at rustcorp.com.au>
To: Richard Henderson <rth at twiddle.net>
Cc: linux-kernel at vger.kernel.org, Nathan Poznick <kraken at drunkmonkey.org>
Subject: Re: [PATCH] Handle R_ALPHA_REFLONG relocation on Alpha
 (2.6.0-test11)
Message-Id: <20031230145736.4ce0ff59.rusty at rustcorp.com.au>
In-Reply-To: <20031218010203.GA13385 at twiddle.net>
References: <20031213003841.GA5213 at wang-fu.org>
	<20031217121010.GA11062 at twiddle.net>
	<20031217193124.GA4837 at wang-fu.org>
	<20031218010203.GA13385 at twiddle.net>
X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: linux-kernel-owner at vger.kernel.org
Precedence: bulk
Status: RO
Content-Length: 2494
Lines: 54

On Wed, 17 Dec 2003 17:02:03 -0800
Richard Henderson <rth at twiddle.net> wrote:

> On Wed, Dec 17, 2003 at 01:31:24PM -0600, Nathan Poznick wrote:
> > my next question is if this is a known/intended side effect -- enabling
> > CONFIG_DEBUG_INFO means that modules cannot be used?
> 
> No.  This means there's a bug in the generic bits of the module
> loaders, that they're not discarding debugging sections.

Ah, my bad.  We suck in the whole module, then copy SHF_ALLOC sections,
then apply relocations.  We don't skip relocations on sections which
haven't been copied.

This patch works for me: Nathan, does it solve your problem?
Rusty.
-- 
   there are those who do and those who hang on and you don't see too
   many doers quoting their contemporaries.  -- Larry McVoy

Name: Don't Apply Relocations To Sections We Haven't Copied
Author: Rusty Russell
Status: Tested on 2.6.0-bk1

D: The module code applies every relocation section given.  Obviously, if
D: the section has not been copied into the module, there's no point.
D: In particular, Alpha has relocs which are only used on debug sections,
D: so they don't load with CONFIG_DEBUG_INFO enabled.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .2481-linux-2.6.0-bk1/kernel/module.c .2481-linux-2.6.0-bk1.updated/kernel/module.c
--- .2481-linux-2.6.0-bk1/kernel/module.c	2003-11-24 15:42:33.000000000 +1100
+++ .2481-linux-2.6.0-bk1.updated/kernel/module.c	2003-12-30 14:08:40.000000000 +1100
@@ -1618,9 +1618,13 @@ static struct module *load_module(void _
 	/* Now do relocations. */
 	for (i = 1; i < hdr->e_shnum; i++) {
 		const char *strtab = (char *)sechdrs[strindex].sh_addr;
-		if (sechdrs[i].sh_type == SHT_REL)
-			err = apply_relocate(sechdrs, strtab, symindex, i,mod);
-		else if (sechdrs[i].sh_type == SHT_RELA)
+
+		/* Skip relocations on non-allocated (ie. debug) sections */
+		if (sechdrs[i].sh_type == SHT_REL
+		    && (sechdrs[sechdrs[i].sh_info].sh_flags & SHF_ALLOC))
+			err = apply_relocate(sechdrs, strtab, symindex,i, mod);
+		else if (sechdrs[i].sh_type == SHT_RELA
+			 && (sechdrs[sechdrs[i].sh_info].sh_flags & SHF_ALLOC))
 			err = apply_relocate_add(sechdrs, strtab, symindex, i,
 						 mod);
 		if (err < 0)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  reply	other threads:[~2006-03-24 23:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-22 10:10 AlphaCore 2.0 vs. AlphaServer 4100 pawel.oleksiak
2006-03-22 11:24 ` tsv
2006-03-23 10:47   ` Odp: " pawel.oleksiak
2006-03-23 17:06     ` tsv
2006-03-23 14:29   ` Jay.Estabrook
2006-03-23 21:07     ` tsv
2006-03-24  9:58       ` Odp: " pawel.oleksiak
2006-03-24 22:55         ` tsv
2006-03-24 23:19           ` michal
2006-03-24 23:27             ` Jay.Estabrook
2006-03-24 23:46               ` michal [this message]
2006-03-24 23:36             ` tsv
2006-03-26 19:46               ` tsv
2006-03-28 10:31           ` Odp: " pawel.oleksiak
2006-03-28 10:49             ` tsv
2006-03-24 22:26 ` bob58523
2006-03-24 23:31   ` Jay.Estabrook
2006-03-24 22:28 ` bob58523
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox