This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Large number of gas warnings compiling linux kernel....
- To: binutils mailing list <binutils at sourceware dot cygnus dot com>
- Subject: Large number of gas warnings compiling linux kernel....
- From: Scott Bambrough <scottb at netwinder dot org>
- Date: Tue, 06 Jun 2000 11:00:05 -0400
- CC: GCC Mailing List <gcc at gcc dot gnu dot org>, Nick Clifton <nickc at cygnus dot com>
- Organization: Rebel.com
Hi guys,
The following code is a reduced example of what I get from compiling a "C"
file with only one line: "#include <linux/module.h>". I'm not sure what is
correct here. I'm sure the compiler has no idea of what the attributes on
.modinfo should be or that it has been declared since it is declared in an
__asm__ statement. I think this particular code works by luck, based on
what the assembler does. Is there a more appropriate way to declare a
a section for the compiler? This code generates a large number of warnings
with the mainline gas compiling the linux kernel.
scott.c: compile with gcc -O0 -S scott.c
/* The attributes of a section are set the first time the section is
seen; we want .modinfo to not be allocated. */
__asm__(".section .modinfo\n\t.previous");
const char __module_kernel_version[] __attribute__((section(".modinfo"))) =
"kernel_version=2.2.14";
scott.s: compile with as-new scott.s
@ Generated by gcc 2.95.2 20000212 (release) [Rebel.com] for ARM/elf
.file "scott.c"
gcc2_compiled.:
.section .modinfo
.previous
.global __module_kernel_version
.section .modinfo,"a",%progbits
.align 2
.type __module_kernel_version,object
.size __module_kernel_version,22
__module_kernel_version:
.ascii "kernel_version=2.2.14\000"
.ident "GCC: (GNU) 2.95.2 20000212 (release) [Rebel.com]"
scott.s: compile with as-new scott.s
@ Generated by gcc 2.96 20000508 (experimental) for ARM/elf
.file "scott.c"
gcc2_compiled.:
.section .modinfo
.previous
.global __module_kernel_version
.section .modinfo,"a"
.align 2
.type __module_kernel_version,object
.size __module_kernel_version,22
__module_kernel_version:
.ascii "kernel_version=2.2.14\000"
.ident "GCC: (GNU) 2.96 20000508 (experimental)"
assembing either of the above with the mainline assembler generates:
scott.s: Assembler messages:
scott.s:7: Warning: Ignoring changed section attributes for .modinfo
Scott
--
Scott Bambrough - Software Engineer
REBEL.COM http://www.rebel.com
NetWinder http://www.netwinder.org