s390x build warnings from <linux/module.h>
Hi,
during 'make modules' on s390x, I see lots of warnings about 'ignoring changed section attributes for __ksymtab' that I have found to be the result of changeset 1.373.196.1, where Kai changed the defaults for module exports to 'no symbols exported'.
The problem is that there is a section '__ksymtab,"a"', while s390x requires it to be '__ksymtab,"aw"' because modules must be compiled with '-fpic' here, unlike afaics all the other architectures.
The patch below is a workaround for the Problem and should be correct on all architectures, but I'd prefer if there was a nicer way to do that.
Arnd <><
include/linux/module.h 15 Oct 2002 15:30:39 -0000 renamed from include/linux/module.h 15 Oct 2002 07:55:01 -0000 1.8 +4 -0
@@ -498,5 +498,9 @@ * "export all symbols" to modutils) */ +#ifndef __PIC__ __asm__(".section __ksymtab,\"a\"\n.previous"); +#else +__asm__(".section __ksymtab,\"aw\"\n.previous"); +#endif #endif
Quoted 8 lines · Arnd Bergmann
during 'make modules' on s390x, I see lots of warnings about 'ignoring changed section attributes for
__ksymtab' that I have found to be the result of changeset 1.373.196.1, where Kai changed the defaults for module exports to 'no symbols exported'.The problem is that there is a section '__ksymtab,"a"', while s390x requires it to be '__ksymtab,"aw"' because modules must be compiled with '-fpic' here, unlike afaics all the other architectures.
Hmmh, there's a couple of things I don't understand, though they're most likely there for a reason. First of all, why do you need -fpic at all? kernel modules are not shared, they should get properly relocated when insmod'ing them, so I don't see why you're doing that.
The next thing I do not understand is why -fpic has the effect of marking the section writeable, does it make .text writeable as well? And what for?
Quoted 9 lines
The patch below is a workaround for the Problem and should be correct on all architectures, but I'd prefer if there was a nicer way to do that.
Arnd <><
include/linux/module.h 15 Oct 2002 15:30:39 -0000 line 505
Quoted 8 lines
include/linux/module.h 15 Oct 2002 15:30:39 -0000 renamed from include/linux/module.h 15 Oct 2002 07:55:01 -0000 1.8 +4
-0@@ -498,5 +498,9 @@ * "export all symbols" to modutils) */ +#ifndef __PIC__ __asm__(".section __ksymtab,\"a\"\n.previous"); +#else +__asm__(".section __ksymtab,\"aw\"\n.previous"); +#endif #endif
Well, it's not too bad, and it's hidden away in a header, so it's fine with me. Still, I don't understand yet why all this happens in the first place.
--Kai