Helge Deller 35dead4235 modules: don't export section names of empty sections via sysfs
On the parisc architecture we face for each and every loaded kernel module
this kernel "badness warning":
  sysfs: cannot create duplicate filename '/module/ac97_bus/sections/.text'
  Badness at fs/sysfs/dir.c:487

Reason for that is, that on parisc all kernel modules do have multiple
.text sections due to the usage of the -ffunction-sections compiler flag
which is needed to reach all jump targets on this platform.

An objdump on such a kernel module gives:
Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .note.gnu.build-id 00000024  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .text         00000000  00000000  00000000  00000058  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .text.ac97_bus_match 0000001c  00000000  00000000  00000058  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  3 .text         00000000  00000000  00000000  000000d4  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
...
Since the .text sections are empty (size of 0 bytes) and won't be
loaded by the kernel module loader anyway, I don't see a reason
why such sections need to be listed under
/sys/module/<module_name>/sections/<section_name> either.

The attached patch does solve this issue by not exporting section
names which are empty.

This fixes bugzilla http://bugzilla.kernel.org/show_bug.cgi?id=14703

Signed-off-by: Helge Deller <deller@gmx.de>
CC: rusty@rustcorp.com.au
CC: akpm@linux-foundation.org
CC: James.Bottomley@HansenPartnership.com
CC: roland@redhat.com
CC: dave@hiauly1.hia.nrc.ca
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-02 15:38:25 -08:00
..
2009-09-21 14:29:21 +02:00
2009-06-24 00:02:38 -04:00
2009-10-29 07:39:25 -07:00
2009-09-18 09:48:52 -07:00
2008-10-16 11:21:30 -07:00
2009-06-16 19:47:48 -07:00
2009-08-29 14:10:07 +02:00
2008-07-28 14:37:38 +02:00
2009-09-19 13:13:17 -07:00
2009-05-15 07:56:24 -05:00
2009-07-24 10:53:29 +02:00
2009-01-14 18:09:02 +01:00
2009-06-18 13:03:56 -07:00
2009-10-29 08:56:20 +10:30
2008-09-02 19:21:40 -07:00
2009-10-07 08:11:20 +02:00
2009-09-23 07:39:41 -07:00
2009-07-12 14:03:27 -07:00
2009-09-23 18:13:10 -07:00
2009-11-02 16:02:39 +01:00
2009-06-18 13:03:55 -07:00