linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 5/23] make section names compatible with -ffunction-sections -fdata-sections: blackfin
  2008-07-02  0:35 [PATCH 5/23] make section names compatible with -ffunction-sections -fdata-sections: blackfin Denys Vlasenko
@ 2008-07-01 22:58 ` Mike Frysinger
  2008-07-02  0:08   ` Denys Vlasenko
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2008-07-01 22:58 UTC (permalink / raw)
  To: Denys Vlasenko
  Cc: linux-arch, Russell King, David Howells, Ralf Baechle,
	Lennert Buytenhek, Josh Boyer, Paul Mackerras, David Woodhouse,
	Andi Kleen, torvalds, akpm, Paul Gortmaker, linux-embedded,
	linux-kernel, Tim Bird, Martin Schwidefsky, Dave Miller

On Tue, Jul 1, 2008 at 8:35 PM, Denys Vlasenko wrote:
> The purpose of this patch is to make kernel buildable
> with "gcc -ffunction-sections -fdata-sections".
> This patch fixes blackfin architecture.

the comment right above what you changed says it already works for
Blackfin.  so you arent fixing it at all.
>                /* This gets done first, so the glob doesn't suck it in */
>                . = ALIGN(32);
> -               *(.data.cacheline_aligned)
> +               *(.cacheline_aligned.data)

ive built Blackfin kernels with function/data sections a long time ago
... but iirc, there were toolchain problems, so i havent pursued it
since.

if you're going to muck with names, you might as well do it right the
first time: move the names into asm-generic/vmlinux.lds.h so we dont
have to worry about this kind of churn again.
-mike

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 5/23] make section names compatible with -ffunction-sections -fdata-sections: blackfin
  2008-07-01 22:58 ` Mike Frysinger
@ 2008-07-02  0:08   ` Denys Vlasenko
  2008-07-02  2:09     ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Denys Vlasenko @ 2008-07-02  0:08 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: linux-arch, Russell King, David Howells, Ralf Baechle,
	Lennert Buytenhek, Josh Boyer, Paul Mackerras, David Woodhouse,
	Andi Kleen, torvalds, akpm, Paul Gortmaker, linux-embedded,
	linux-kernel, Tim Bird, Martin Schwidefsky, Dave Miller

On Wednesday 02 July 2008 00:58, Mike Frysinger wrote:
> On Tue, Jul 1, 2008 at 8:35 PM, Denys Vlasenko wrote:
> > The purpose of this patch is to make kernel buildable
> > with "gcc -ffunction-sections -fdata-sections".
> > This patch fixes blackfin architecture.
> 
> the comment right above what you changed says it already works for
> Blackfin.  so you arent fixing it at all.
> >                /* This gets done first, so the glob doesn't suck it in */
> >                . = ALIGN(32);
> > -               *(.data.cacheline_aligned)
> > +               *(.cacheline_aligned.data)

This may pull in an unrelated data object named "cacheline_aligned"
(say, a static variable in a driver). If that variable is not
itself aligned to the cacheline size, it will mess up alignment of all
objects in .data.cacheline_aligned which follow. Not good.

To be safe from such weird and hard to debug problems
it's better to not use names like .data.XXXX at all.
I just uniformly renamed al such "special sections"
in the kernel to .XXXXX.data
--
vda

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 5/23] make section names compatible with -ffunction-sections -fdata-sections: blackfin
@ 2008-07-02  0:35 Denys Vlasenko
  2008-07-01 22:58 ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Denys Vlasenko @ 2008-07-02  0:35 UTC (permalink / raw)
  To: linux-arch
  Cc: Russell King, David Howells, Ralf Baechle, Lennert Buytenhek,
	Josh Boyer, Paul Mackerras, David Woodhouse, Andi Kleen, torvalds,
	akpm, Paul Gortmaker, linux-embedded, linux-kernel, Tim Bird,
	Martin Schwidefsky, Dave Miller

The purpose of this patch is to make kernel buildable
with "gcc -ffunction-sections -fdata-sections".
This patch fixes blackfin architecture.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
--
vda


--- 0.org/arch/blackfin/kernel/vmlinux.lds.S	Wed Jul  2 00:40:40 2008
+++ 1.fixname/arch/blackfin/kernel/vmlinux.lds.S	Wed Jul  2 00:45:51 2008
@@ -91,7 +91,7 @@
 		__sdata = .;
 		/* This gets done first, so the glob doesn't suck it in */
 		. = ALIGN(32);
-		*(.data.cacheline_aligned)
+		*(.cacheline_aligned.data)
 
 #if !L1_DATA_A_LENGTH
 		. = ALIGN(32);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 5/23] make section names compatible with -ffunction-sections -fdata-sections: blackfin
  2008-07-02  0:08   ` Denys Vlasenko
@ 2008-07-02  2:09     ` Mike Frysinger
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2008-07-02  2:09 UTC (permalink / raw)
  To: Denys Vlasenko
  Cc: linux-arch, Russell King, David Howells, Ralf Baechle,
	Lennert Buytenhek, Josh Boyer, Paul Mackerras, David Woodhouse,
	Andi Kleen, torvalds, akpm, Paul Gortmaker, linux-embedded,
	linux-kernel, Tim Bird, Martin Schwidefsky, Dave Miller

On Tue, Jul 1, 2008 at 8:08 PM, Denys Vlasenko wrote:
> On Wednesday 02 July 2008 00:58, Mike Frysinger wrote:
>> On Tue, Jul 1, 2008 at 8:35 PM, Denys Vlasenko wrote:
>> > The purpose of this patch is to make kernel buildable
>> > with "gcc -ffunction-sections -fdata-sections".
>> > This patch fixes blackfin architecture.
>>
>> the comment right above what you changed says it already works for
>> Blackfin.  so you arent fixing it at all.
>> >                /* This gets done first, so the glob doesn't suck it in */
>> >                . = ALIGN(32);
>> > -               *(.data.cacheline_aligned)
>> > +               *(.cacheline_aligned.data)
>
> This may pull in an unrelated data object named "cacheline_aligned"
> (say, a static variable in a driver). If that variable is not
> itself aligned to the cacheline size, it will mess up alignment of all
> objects in .data.cacheline_aligned which follow. Not good.
>
> To be safe from such weird and hard to debug problems
> it's better to not use names like .data.XXXX at all.
> I just uniformly renamed al such "special sections"
> in the kernel to .XXXXX.data

you're right of course ... i obviously hadnt thought of this.  please
however still abstract this stuff into the common header.

i just tested the current Blackfin kernel and it does build/link/run
fine with -ffunction-sections/-fdata-sections.  however, --gc-sections
still causes crashes (but this is because all of the .init.setup
sections are flagged as unused).
-mike

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-02  2:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-02  0:35 [PATCH 5/23] make section names compatible with -ffunction-sections -fdata-sections: blackfin Denys Vlasenko
2008-07-01 22:58 ` Mike Frysinger
2008-07-02  0:08   ` Denys Vlasenko
2008-07-02  2:09     ` Mike Frysinger

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).