https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62108

            Bug ID: 62108
           Summary: Resolution of mismatched __attribute__ ((__section__
                    (""))) changes between 4.9 and 4.10.
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jgreenhalgh at gcc dot gnu.org

In this testcase:

void func(void);

void __attribute__((__section__("bar")))
func (void) 
{
}

There is a mismatch between the section attribute given to the prototype (none,
so ".text") and the definition ("bar") of func.

Compiling this testcase with a 4.9 and a 4.10 compiler using

  gcc test.c -c

and dumping with

  objdump -x 

Gives different results between 4.9.1 (4.9.1 release) and 4.10.0 (20140803
(experimental)):

$ objdump -x 4.9.o | grep func

0000000000000000 g     F bar    0000000000000006 func

$ objdump -x 4.10.o | grep func

0000000000000000 g     F .text    0000000000000007 func

This trips up an ARM kernel build.

We should either error on the mismatch, provide a consistent behaviour, or
document the change if this is expected.

Reply via email to