Large number of gas warnings compiling linux kernel....
Nick Clifton
nickc@cygnus.com
Tue Jun 6 09:13:00 GMT 2000
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
More information about the Binutils
mailing list