This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Large number of gas warnings compiling linux kernel....
- To: scottb at netwinder dot org
- Subject: Re: Large number of gas warnings compiling linux kernel....
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Tue, 6 Jun 2000 09:13:57 -0700
- CC: binutils at sourceware dot cygnus dot com, gcc at gcc dot gnu dot org
Hi Scott,
: /* 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";
GCC is adding the section attributes because it is trying to be
helpful. (For example see the definition of ASM_OUTPUT_SECTION_NAME
in gcc/config/arm/linux-elf.h). There is (rather grungy) workaround
however - put a comment character at the end of the section's name
when defining the attribute:
const char __module_kernel_version[] __attribute__((section(".modinfo\n\t#"))) =
"kernel_version=2.2.14";
Which will generate assembler output like this:
.section .modinfo
#,"a"
.align 3
Cheers
Nick