All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@oss.sgi.com>
To: Greg Satz <satz@ayrnetworks.com>
Cc: linux-mips@oss.sgi.com
Subject: Re: SHN_MIPS_SCOMMON
Date: Sat, 21 Jul 2001 14:11:20 +0200	[thread overview]
Message-ID: <20010721141119.A25053@bacchus.dhis.org> (raw)
In-Reply-To: <B77EA5E8.883E%satz@ayrnetworks.com>; from satz@ayrnetworks.com on Sat, Jul 21, 2001 at 03:22:17AM -0600

On Sat, Jul 21, 2001 at 03:22:17AM -0600, Greg Satz wrote:

> Hi Ralf, maybe I am missing something but after downloading and some perusal
> I don't see where the newer (2.4.5) kernel addresses this problem. At the
> risk of being redundant, the issue, as I see it, is the use of SCOMMON
> symbols in ELF section SHN_MIPS_SCOMMON (0xff03). These symbols are
> overlooked when insmod relocates symbols in the SHN_COMMON ELF section. They
> end up in the kernel with a value of 4. Upon being referenced, the module
> gets a page fault opps.
> 
> The file obj/obj_reloc.c in the modutils package is where the SHN_COMMON
> symbol relocation work is performed. Using the gcc flag -fno-common forces
> all commons info bss thus preventing the problem. We do this as a
> work-around now.
> 
> The question is whether the gcc -fno-common flag is the real fix or is
> obj/obj_reloc.c deficient. I have a patch that appears to work for
> obj/obj_reloc.c
> 
> We create the problem situation by declaring variables in one file as extern
> and defining them in another.

You have common declarations that's declarations without static or extern
keywords and initalization.  Perfectly legal.

> The compiler puts these variables in the SCOMMON segment instead of the
> COMMON segment.

Only if you don't compile / assemble / link with -G 0.

.scommon shouldn't ever be in a kernel object.  It seems that ld started
to move .common objects to .scommon from a certain version on, so 2.4.5
now passes the right options.  .scommon is used in global pointer
optimizations which doesn't work under Linux anyway as we use $gp ($28)
for a different purpose.  So modutils should reject such a module right
away.

  Ralf

  reply	other threads:[~2001-07-21 12:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-20 22:15 SHN_MIPS_SCOMMON Greg Satz
2001-07-20 22:15 ` SHN_MIPS_SCOMMON Greg Satz
2001-07-21  1:30 ` SHN_MIPS_SCOMMON Ralf Baechle
2001-07-21  9:22   ` SHN_MIPS_SCOMMON Greg Satz
2001-07-21  9:22     ` SHN_MIPS_SCOMMON Greg Satz
2001-07-21 12:11     ` Ralf Baechle [this message]
2001-07-21 17:41       ` SHN_MIPS_SCOMMON H . J . Lu
2001-07-21 18:12         ` SHN_MIPS_SCOMMON Greg Satz
2001-07-21 18:12           ` SHN_MIPS_SCOMMON Greg Satz
2001-07-21 18:13           ` SHN_MIPS_SCOMMON H . J . Lu
2001-07-21 18:56             ` SHN_MIPS_SCOMMON Ralf Baechle
2001-07-21 19:03               ` SHN_MIPS_SCOMMON H . J . Lu
2001-07-21 23:20                 ` SHN_MIPS_SCOMMON Ralf Baechle
2001-07-21 18:55         ` SHN_MIPS_SCOMMON Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010721141119.A25053@bacchus.dhis.org \
    --to=ralf@oss.sgi.com \
    --cc=linux-mips@oss.sgi.com \
    --cc=satz@ayrnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.