linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denys Vlasenko <vda.linux@googlemail.com>
To: Tim Abbott <tabbott@ksplice.com>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>,
	Matt Fleming <matt@console-pimps.org>,
	linux-arch@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>,
	Michal Marek <mmarek@suse.cz>
Subject: Re: [PATCH 1/5] vmlinux.lds.h: Include *(.text.*) in TEXT_TEXT
Date: Thu, 17 Jun 2010 20:54:23 +0200	[thread overview]
Message-ID: <AANLkTik0QxlSuBk0AKHBMET415vcYhaXSWNQf0GVeBn0@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.10.1006141608550.1248@dr-wily.mit.edu>

On Tue, Jun 15, 2010 at 12:02 AM, Tim Abbott <tabbott@ksplice.com> wrote:
> On Mon, 14 Jun 2010, James Bottomley wrote:
>
>> On Mon, 2010-06-14 at 20:33 +0100, Matt Fleming wrote:
>> > On Mon, 14 Jun 2010 10:32:46 -0400 (EDT), Tim Abbott <tabbott@ksplice.com> wrote:
>> > >
>> > > I was planning to submit in the next couple weeks a change that adds
>> > > support for building the kernel with -ffunction-sections -fdata-sections,
>> > > which would have as a piece of it adding to TEXT_TEXT the following
>> > > expression:
>> > >
>> > >   *(.text.[A-Za-z$_]*)    /* handle -ffunction-sections */\
>>
>> Just as a point of technical interest, that won't handle
>> -ffunction-sections.  At least on parisc, we get a
>> section .text.<function name> for every function.  This means that any
>> character legal in a function name can appear there, not just letters
>> and underscores (we get millicode ones with dollar signs as well for
>> instance).  That's why *(.text.*) is safer
>
> Hi James,
>
> I believe that the pattern [A-Za-z$_] matches all valid characters to
> start a function name (in particular, it includes "$").  If I'm missing
> any valid characters for the start of a function name, please correct me.

Yes, I think we need to add 0-9 too. C names can't have a digit as a starting
character, but linker can produce such names when invoked as "ld -r --unique"
(incremental linking).

Currently we use just "ld -r" to combine all .o files from a directory
into one bigger .o file, but this combines all similarly-named sections.
This not only combines all .text sections from every input .o file
into one .text section (which isn't surprising), but also combines
all .text.func sections too. Which we don't want to happen when we
(eventually) want to link kernel with --gc-sections.

The fix already exists: "ld -r --unique". With --unique, ld
will create unique sections named .text.1, .text.2, .text.func.1
and such.

Therefore, in order to accomodate .text.NUM sections in the future,
we'd better use .text.[A-Za-z0-9$_]* pattern.

-- 
vda

  parent reply	other threads:[~2010-06-17 18:54 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 12:38 [PATCH 1/5] vmlinux.lds.h: Include *(.text.*) in TEXT_TEXT Matt Fleming
2010-06-14 12:38 ` Matt Fleming
2010-06-14 12:38 ` [PATCH 2/5] blackfin: Remove *(.text.*) pattern from the linker script Matt Fleming
2010-06-14 12:38   ` Matt Fleming
2010-06-14 19:58   ` Mike Frysinger
2010-06-14 12:38 ` [PATCH 3/5] mips: " Matt Fleming
2010-06-14 12:38   ` Matt Fleming
2010-06-14 12:38 ` [PATCH 4/5] parisc: " Matt Fleming
2010-06-14 12:38   ` Matt Fleming
2010-06-14 15:20   ` James Bottomley
2010-06-14 19:13     ` Matt Fleming
2010-06-14 12:38 ` [PATCH 5/5] score: " Matt Fleming
2010-06-14 12:38   ` Matt Fleming
2010-06-14 14:32 ` [PATCH 1/5] vmlinux.lds.h: Include *(.text.*) in TEXT_TEXT Tim Abbott
2010-06-14 19:33   ` Matt Fleming
2010-06-14 20:05     ` James Bottomley
2010-06-14 22:02       ` Tim Abbott
2010-06-14 23:08         ` James Bottomley
2010-06-15  2:45           ` Tim Abbott
2010-06-15  2:45             ` Tim Abbott
2010-06-16 21:40             ` James Bottomley
2010-06-16 21:40               ` James Bottomley
2010-06-17 19:11               ` Denys Vlasenko
2010-06-17 19:56                 ` James Bottomley
2010-06-17 20:19                   ` Denys Vlasenko
2010-06-17 20:19                     ` Denys Vlasenko
2010-06-17 20:38                     ` James Bottomley
2010-06-17 18:54         ` Denys Vlasenko [this message]
2010-06-14 22:21     ` Tim Abbott
2010-06-14 23:14       ` James Bottomley
2010-06-15  2:52         ` Tim Abbott
2010-06-15  2:52           ` Tim Abbott
2010-06-14 18:22 ` Sam Ravnborg
2010-06-14 18:22   ` Sam Ravnborg
2010-06-14 19:21   ` Matt Fleming

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=AANLkTik0QxlSuBk0AKHBMET415vcYhaXSWNQf0GVeBn0@mail.gmail.com \
    --to=vda.linux@googlemail.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@console-pimps.org \
    --cc=mmarek@suse.cz \
    --cc=sam@ravnborg.org \
    --cc=tabbott@ksplice.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 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).