<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/module.c, branch v2.6.31.13</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/module.c?h=v2.6.31.13</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/module.c?h=v2.6.31.13'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2009-12-08T18:22:23Z</updated>
<entry>
<title>modules: don't export section names of empty sections via sysfs</title>
<updated>2009-12-08T18:22:23Z</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2009-12-02T23:29:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a5aeface580afa4d2daba4980cd26f53ed31787a'/>
<id>urn:sha1:a5aeface580afa4d2daba4980cd26f53ed31787a</id>
<content type='text'>
commit 35dead4235e2b67da7275b4122fed37099c2f462 upstream.

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/&lt;module_name&gt;/sections/&lt;section_name&gt; 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 &lt;deller@gmx.de&gt;
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 &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>modules: Fix build error in the !CONFIG_KALLSYMS case</title>
<updated>2009-08-29T05:35:00Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-08-28T08:44:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ea6bff368548d79529421a9dc0710fc5330eb504'/>
<id>urn:sha1:ea6bff368548d79529421a9dc0710fc5330eb504</id>
<content type='text'>
&gt; James Bottomley (1):
&gt;       module: workaround duplicate section names

-tip testing found that this patch breaks the build on x86 if
CONFIG_KALLSYMS is disabled:

 kernel/module.c: In function ‘load_module’:
 kernel/module.c:2367: error: ‘struct module’ has no member named ‘sect_attrs’
 distcc[8269] ERROR: compile kernel/module.c on ph/32 failed
 make[1]: *** [kernel/module.o] Error 1
 make: *** [kernel] Error 2
 make: *** Waiting for unfinished jobs....

Commit 1b364bf misses the fact that section attributes are only
built and dealt with if kallsyms is enabled. The patch below fixes
this.

( note, technically speaking this should depend on CONFIG_SYSFS as
  well but this patch is correct too and keeps the #ifdef less
  intrusive - in the KALLSYMS &amp;&amp; !SYSFS case the code is a NOP. )

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
[ Replaced patch with a slightly cleaner variation by James Bottomley ]
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>module: workaround duplicate section names</title>
<updated>2009-08-27T19:33:19Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2009-08-26T12:34:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1b364bf438cf337a3818aee77d68c0713f3e1fc4'/>
<id>urn:sha1:1b364bf438cf337a3818aee77d68c0713f3e1fc4</id>
<content type='text'>
The root cause is a duplicate section name (.text); is this legal?
[ Amerigo Wang: "AFAIK, yes." ]

However, there's a problem with commit
6d76013381ed28979cd122eb4b249a88b5e384fa in that if you fail to allocate
a mod-&gt;sect_attrs (in this case it's null because of the duplication),
it still gets used without checking in add_notes_attrs()

This should fix it

[ This patch leaves other problems, particularly the sections directory,
  but recent parisc toolchains seem to produce these modules and this
  prevents a crash and is a minimal change -- RR ]

Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Tested-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>module: fix BUG_ON() for powerpc (and other function descriptor archs)</title>
<updated>2009-08-27T19:33:19Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2009-08-26T12:32:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7d1d16e416e61aeef8655d542f8e4a4fc6e808e4'/>
<id>urn:sha1:7d1d16e416e61aeef8655d542f8e4a4fc6e808e4</id>
<content type='text'>
The rarely-used symbol_put_addr() needs to use dereference_function_descriptor
on powerpc.

Reported-by: Paul Mackerras &lt;paulus@samba.org&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au.
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>module: use MODULE_SYMBOL_PREFIX with module_layout</title>
<updated>2009-07-27T19:15:45Z</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@gentoo.org</email>
</author>
<published>2009-07-23T14:12:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6560dc160f3a96b8f1f43e2c6b51aa6eb9898b90'/>
<id>urn:sha1:6560dc160f3a96b8f1f43e2c6b51aa6eb9898b90</id>
<content type='text'>
The check_modstruct_version() needs to look up the symbol "module_layout"
in the kernel, but it does so literally and not by a C identifier.  The
trouble is that it does not include a symbol prefix for those ports that
need it (like the Blackfin and H8300 port).  So make sure we tack on the
MODULE_SYMBOL_PREFIX define to the front of it.

Signed-off-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Remove multiple KERN_ prefixes from printk formats</title>
<updated>2009-07-08T17:30:03Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2009-07-06T20:05:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ad361c9884e809340f6daca80d56a9e9c871690a'/>
<id>urn:sha1:ad361c9884e809340f6daca80d56a9e9c871690a</id>
<content type='text'>
Commit 5fd29d6ccbc98884569d6f3105aeca70858b3e0f ("printk: clean up
handling of log-levels and newlines") changed printk semantics.  printk
lines with multiple KERN_&lt;level&gt; prefixes are no longer emitted as
before the patch.

&lt;level&gt; is now included in the output on each additional use.

Remove all uses of multiple KERN_&lt;level&gt;s in formats.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>kernel: constructor support</title>
<updated>2009-06-18T20:03:57Z</updated>
<author>
<name>Peter Oberparleiter</name>
<email>oberpar@linux.vnet.ibm.com</email>
</author>
<published>2009-06-17T23:28:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b99b87f70c7785ab1e253c6220f4b0b57ce3a7f7'/>
<id>urn:sha1:b99b87f70c7785ab1e253c6220f4b0b57ce3a7f7</id>
<content type='text'>
Call constructors (gcc-generated initcall-like functions) during kernel
start and module load.  Constructors are e.g.  used for gcov data
initialization.

Disable constructor support for usermode Linux to prevent conflicts with
host glibc.

Signed-off-by: Peter Oberparleiter &lt;oberpar@linux.vnet.ibm.com&gt;
Acked-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Acked-by: WANG Cong &lt;xiyou.wangcong@gmail.com&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Cc: Jeff Dike &lt;jdike@addtoit.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: Huang Ying &lt;ying.huang@intel.com&gt;
Cc: Li Wei &lt;W.Li@Sun.COM&gt;
Cc: Michael Ellerman &lt;michaele@au1.ibm.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Heiko Carstens &lt;heicars2@linux.vnet.ibm.com&gt;
Cc: Martin Schwidefsky &lt;mschwid2@linux.vnet.ibm.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>printk: add KERN_DEFAULT loglevel to print_modules()</title>
<updated>2009-06-16T18:07:14Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-06-16T18:07:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b231125af7811a2f68c455d3bda95ac170ee4fa6'/>
<id>urn:sha1:b231125af7811a2f68c455d3bda95ac170ee4fa6</id>
<content type='text'>
Several WARN_ON() messages omit the '\n' at the end of the string, which
is a simple (and understandable) error.  The next line printed after
that warning line is usually the current module list, and that printk
does not have a log-level marker - resulting in one long mixed-up line.

Adding this loglevel marker will now avoid this unreadable mess.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>module: trim exception table on init free.</title>
<updated>2009-06-12T12:17:04Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2009-06-13T03:47:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ad6561dffa17f17bb68d7207d422c26c381c4313'/>
<id>urn:sha1:ad6561dffa17f17bb68d7207d422c26c381c4313</id>
<content type='text'>
It's theoretically possible that there are exception table entries
which point into the (freed) init text of modules.  These could cause
future problems if other modules get loaded into that memory and cause
an exception as we'd see the wrong fixup.  The only case I know of is
kvm-intel.ko (when CONFIG_CC_OPTIMIZE_FOR_SIZE=n).

Amerigo fixed this long-standing FIXME in the x86 version, but this
patch is more general.

This implements trim_init_extable(); most archs are simple since they
use the standard lib/extable.c sort code.  Alpha and IA64 use relative
addresses in their fixups, so thier trimming is a slight variation.

Sparc32 is unique; it doesn't seem to define ARCH_HAS_SORT_EXTABLE,
yet it defines its own sort_extable() which overrides the one in lib.
It doesn't sort, so we have to mark deleted entries instead of
actually trimming them.

Inspired-by: Amerigo Wang &lt;amwang@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: linux-alpha@vger.kernel.org
Cc: sparclinux@vger.kernel.org
Cc: linux-ia64@vger.kernel.org
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://linux-arm.org/linux-2.6</title>
<updated>2009-06-11T21:15:57Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-06-11T21:15:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=512626a04e72aca60effe111fa0333ed0b195d21'/>
<id>urn:sha1:512626a04e72aca60effe111fa0333ed0b195d21</id>
<content type='text'>
* 'for-linus' of git://linux-arm.org/linux-2.6:
  kmemleak: Add the corresponding MAINTAINERS entry
  kmemleak: Simple testing module for kmemleak
  kmemleak: Enable the building of the memory leak detector
  kmemleak: Remove some of the kmemleak false positives
  kmemleak: Add modules support
  kmemleak: Add kmemleak_alloc callback from alloc_large_system_hash
  kmemleak: Add the vmalloc memory allocation/freeing hooks
  kmemleak: Add the slub memory allocation/freeing hooks
  kmemleak: Add the slob memory allocation/freeing hooks
  kmemleak: Add the slab memory allocation/freeing hooks
  kmemleak: Add documentation on the memory leak detector
  kmemleak: Add the base support

Manual conflict resolution (with the slab/earlyboot changes) in:
	drivers/char/vt.c
	init/main.c
	mm/slab.c
</content>
</entry>
</feed>
