This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Large number of gas warnings compiling linux kernel....


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]