mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicholas Piggin <nicholas.piggin@gmail.com>
To: "Luis R. Rodriguez" <mcgrof@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>, Michael Matz <matz@suse.de>,
	Nicholas Piggin <npiggin@gmail.com>,
	David Ahern <dsahern@gmail.com>,
	Kees Cook <keescook@chromium.org>, Wang Nan <wangnan0@huawei.com>,
	Fengguang Wu <fengguang.wu@intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Joerg Roedel <joro@8bytes.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: linker-tables v5 testing
Date: Fri, 9 Dec 2016 12:11:13 +1000	[thread overview]
Message-ID: <20161209121113.31847049@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <CAB=NE6UpmbQXbRpua2p8KKRspVzb8GtuNG8JrAN69t79-xU86g@mail.gmail.com>

On Fri, 2 Dec 2016 07:49:52 -0800
"Luis R. Rodriguez" <mcgrof@kernel.org> wrote:

> On Thu, Dec 1, 2016 at 10:31 PM, Nicholas Piggin
> <nicholas.piggin@gmail.com> wrote:
> >
> > On 2 Dec 2016 2:35 AM, "Luis R. Rodriguez" <mcgrof@kernel.org> wrote:  
> >>
> >> On Wed, Nov 30, 2016 at 9:20 PM, Nicholas Piggin <npiggin@gmail.com>
> >> wrote:  
> >> > On Thu, 1 Dec 2016 16:04:30 +1100
> >> > Nicholas Piggin <npiggin@gmail.com> wrote:
> >> >  
> >> >> On Wed, 30 Nov 2016 19:15:27 -0800
> >> >> "Luis R. Rodriguez" <mcgrof@kernel.org> wrote:
> >> >>  
> >> >> > On Wed, Nov 30, 2016 at 6:51 PM, Nicholas Piggin <npiggin@gmail.com>
> >> >> > wrote:  
> >> >> > > On Wed, 30 Nov 2016 18:38:16 +0100
> >> >> > > "Luis R. Rodriguez" <mcgrof@kernel.org> wrote:
> >> >> > >  
> >> >> > >> On Wed, Nov 30, 2016 at 02:09:47PM +1100, Nicholas Piggin wrote:  
> >> >>  
> >> >> > >> What is wrong with that ? Separating linker table and section
> >> >> > >> ranges is  
> >> >> > >
> >> >> > > It's not that you separate those, of course you need that. It's
> >> >> > > that
> >> >> > > you also separate other sections from the input section
> >> >> > > descriptions:
> >> >> > >
> >> >> > > -               *(.text.hot .text .text.fixup .text.unlikely)
> >> >> > > \
> >> >> > > +               *(.text.hot .text)
> >> >> > > \
> >> >> > > +               *(SORT(.text.rng.*))
> >> >> > > \
> >> >> > > +               *(.text.fixup .text.unlikely)
> >> >> > > \  
> >> >
> >> > Ahh, you're doing it to avoid clash with compiler generated sections.  
> >>
> >> Nope, its for two reasons:
> >>
> >> 1) To be able to construct arrays without modifying the linker script
> >> we had to get crafty, and opted in for the trick of picking two
> >> arbitrary delimiters for use of section start, and section end, namely
> >> the tilde character ("~") and the empty string (""), and then stuffing
> >> anything in between. For this to work properly we must SORT() these
> >> specially crafted sections as well.
> >>
> >> 2) Because I don't want to regress .text if SORT()'ing it breaks
> >> something. In theory it should not but I rather be careful.  
> >
> > Oh yes I wasn't talking about the sort itself, but about why you broke up
> > the existing input section descriptions.  
> 
> Ah, but I was also talking about this, the only thing is...
> 
> > That was my only concern, e.g.,
> > .data and .data.[_0-9a-zA-Z] spoke be in the same description.  
> 
> I was talking about splitting up .data and both .data.tbl .data.rng --
> you were talking specifically only about .data and .data.[_0-9a-zA-Z]
> and now I see the concern! Yes, you are -- we can avoid this, its just
> your glob would also capture .data.tbl and data.rng and I want to sort
> these so I do it first. But as you already deduced, this should still
> have no harm as I am just stuffing it in well sorted first and the
> later glob just captures that. I could have just used .data..tbl and
> data..rng as you noted. Either way is fine by me.
> 
> Do you have a preference?

I would say use "..", just so there is less ambiguity and more
flexibility in moving around the input section descriptions if needed.

> 
> >> > The usual way to cope with that seems to be to use two dots for your
> >> > name.
> >> > .text..rng.*  
> >>
> >> I have been wondering why people started doing that, it was not clear
> >> nor documented anywhere. So no, it was not my original motivation, but
> >> if it helps, it will be good to document this as well.  
> >
> > Yeah it's convention because . can be part of a section name but not a C
> > symbol.  
> 
> Great, makes sense -- do you have references for this practice BTW or
> did you just infer this?

I believe I've seen something, perhaps it was in the binutils manuals,
but I tried just now and couldn't find anything.

It is a common practice to use dots in labels to avoid clashes with C
names in general. Specifically for sections we already have some cases
in there which I believe were added for similar reasons.

Thanks,
Nick

  reply	other threads:[~2016-12-09  2:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24  4:11 Luis R. Rodriguez
2016-11-24  4:57 ` Guenter Roeck
2016-11-24 16:18 ` Guenter Roeck
2016-11-30  1:33   ` Luis R. Rodriguez
2016-11-30  3:09     ` Nicholas Piggin
2016-11-30 17:38       ` Luis R. Rodriguez
2016-12-01  2:51         ` Nicholas Piggin
2016-12-01  3:15           ` Luis R. Rodriguez
2016-12-01  5:04             ` Nicholas Piggin
2016-12-01  5:20               ` Nicholas Piggin
2016-12-01 16:34                 ` Luis R. Rodriguez
     [not found]                   ` <CANashXMF3jWNgxaSQLRg2b88fSo1xEw-CDFQ6D94eoNn=mYuHQ@mail.gmail.com>
     [not found]                     ` <CANashXOkLvy6BHupz8r-yNvihbohoXdrSQ38uq3jg2q3bGjX_w@mail.gmail.com>
     [not found]                       ` <CANashXOb2jGtXr3BmxVKERPDp-DAHtZXYneZDEf07YpMmoqb-w@mail.gmail.com>
2016-12-02 15:49                         ` Luis R. Rodriguez
2016-12-09  2:11                           ` Nicholas Piggin [this message]
2016-12-02 20:20             ` Luis R. Rodriguez
2016-11-30  4:17     ` Guenter Roeck

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=20161209121113.31847049@roar.ozlabs.ibm.com \
    --to=nicholas.piggin@gmail.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=dsahern@gmail.com \
    --cc=fengguang.wu@intel.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=joro@8bytes.org \
    --cc=jpoimboe@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=matz@suse.de \
    --cc=mcgrof@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=wangnan0@huawei.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

all inboxes | Powered by JetHome®