All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denys Vlasenko <vda.linux@googlemail.com>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: Tim Abbott <tabbott@ksplice.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>,
	Parisc List <linux-parisc@vger.kernel.org>
Subject: Re: [PATCH 1/5] vmlinux.lds.h: Include *(.text.*) in TEXT_TEXT
Date: Thu, 17 Jun 2010 22:19:07 +0200	[thread overview]
Message-ID: <AANLkTink485wn-EaLibaD3Xh7X5RwXM06d6jx3GijD40@mail.gmail.com> (raw)
In-Reply-To: <1276804567.7398.264.camel@mulgrave.site>

>> This is doable in asm, yes. For .bss, we need to not forget about
>> @nobits too: section .bss.foo,"aw",@nobits
>
> That's only for bss ... we have about a handful of such statements and
> they always use the assembler .bss directive (which doesn't need flags).
>
>> > Actually, as I said, that would be .data-

You are right, in assembly we can specify needed attributes.

I am more concerned about C:

arch/x86/include/asm/cache.h:
#define __read_mostly __attribute__((__section__(".data..read_mostly")))

If we change it to

#define __read_mostly __attribute__((__section__(".data-read_mostly")))

What makes this section have correct attributes?

With current gcc, __attribute__((__section__(".bss-page_aligned")))
does get wrong attributes. That's why we settled on .bss..foo
scheme.

> I thought I just refuted that in the above: we don't care what the
> assembler sections are flagged as because the linker script gets to pick
> the flags anyway ... so most bugs arrived at this way have no visible
> side effects ... and section merging problems have to be accounted for
> anyway in the final linker scripts.

When I was working on a older iteration of this patch,
I renamed .bss.page_aligned to .page_aligned.bss
and was bitten by linker bug: linker tried to merge
the sections and corrupted them.

Aha, here is it:
http://sourceware.org/bugzilla/show_bug.cgi?id=5006

It was since fixed, and if I read the ld patch correctly,
now ld emits a warning and switches entire target section
to PROGBITS - not what we want to happen to bss.

-- 
vda

  reply	other threads:[~2010-06-17 20:19 UTC|newest]

Thread overview: 28+ 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 ` [PATCH 2/5] blackfin: Remove *(.text.*) pattern from the linker script Matt Fleming
2010-06-14 19:58   ` Mike Frysinger
2010-06-14 19:58     ` Mike Frysinger
2010-06-14 12:38 ` [PATCH 3/5] mips: " Matt Fleming
2010-06-14 12:38 ` [PATCH 4/5] parisc: " 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 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-16 21:40             ` James Bottomley
2010-06-17 19:11               ` Denys Vlasenko
2010-06-17 19:11                 ` Denys Vlasenko
2010-06-17 19:56                 ` James Bottomley
2010-06-17 20:19                   ` Denys Vlasenko [this message]
2010-06-17 20:38                     ` James Bottomley
2010-06-17 18:54         ` Denys Vlasenko
2010-06-14 22:21     ` Tim Abbott
2010-06-14 23:14       ` James Bottomley
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=AANLkTink485wn-EaLibaD3Xh7X5RwXM06d6jx3GijD40@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=linux-parisc@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 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.