Re: [PATCH] Add non-zero module sections to sysfs

Philip Kranz
2013-04-08T11:55:56Z

On Mon, Apr 08, 2013 at 01:44:45PM +0930, Rusty Russell wrote:
> Philip Kranz <philip.kranz@googlemail.com> writes:
> > I am not able to produce an object file with duplicate section names
> > using gcc on x86. Even with -ffunction-sections, every section gets a
> > unique name. Is this architecture-specific behaviour of gcc?
>
> Good point. ld -r will collapse them into the same section (since gcc
> produces them they have to have the same section attributes).
>
> You can do it with --unique, but no arch uses that. PARISC has a
> platform-specific toolchain hack which does that for .text sections.
> (Thanks to Alan Modra for that clue...)

So that problem is indeed platform-specific. If it is safe to assume
that kernel modules don't have duplicate section names (except on
PARISC), it would make sense to simply move the check for empty sections
to arch/parisc as you suggested.

James, what do you think about that?

Greetings,
Philip