linux-mips
[Top] [All Lists]

Re: [RFC] Add __initbss section

To: Franck Bui-Huu <vagabon.xyz@gmail.com>
Subject: Re: [RFC] Add __initbss section
From: Ralf Baechle <ralf@linux-mips.org>
Date: Thu, 11 Oct 2007 13:44:10 +0100
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>, Geert Uytterhoeven <geert@linux-m68k.org>, linux-mips <linux-mips@linux-mips.org>
In-reply-to: <470DF25E.60009@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <470DF25E.60009@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.14 (2007-02-12)
On Thu, Oct 11, 2007 at 11:52:30AM +0200, Franck Bui-Huu wrote:

> Other question: I noticed that the exit.data section is not
> discarded. Could anybody give me the reason why ?

.exit.data and .exit.text may reference each other.  __exit functions
generally get compiled into .exit.text but some constructs such as jump
tables for switch() constructs may be compiled into address tables which
gcc unfortunately will put into .rodata, so .rodata will end up
referencing function addresses in .exit.text which makes ld unhappy if
.exit.text was discarded.  So until this is fixed in gcc we can't
discard exit code, unfortunately.

It's actually an issue which doesn't strike very often, so users who are
desparate for shrinking the kernel down could try to undo patchsets:

  6f0b1e5d266fb1d0da019c07b56ccc02c3a4f53a
  ca7402fed2a76cd5a417ac4d375a5539dcb2b6de

and see if they can get away with it.  If the final kernel link succeeds,
the build would be ok.

I think gcc should probably put the jump table into a .subsection if
a section was explicitly requested, at least for non-PIC code.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>