This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

middle-end/6697: __attribute__((section ("name"))) unjustified (?) conflicts

>Number:         6697
>Category:       middle-end
>Synopsis:       Unjustified (?) __attribute__ section conflicts
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Fri May 17 08:46:00 PDT 2002
>Originator:     David Decotigny
>Release:        3.1
IRISA, Campus de Beaulieu, 35042 Rennes Cedex, FRANCE
System: SunOS blutch 5.7 Generic_106541-15 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4

host: sparc-sun-solaris2.7
build: sparc-sun-solaris2.7
target: i586-pc-gnu
configured with: ./configure --prefix=/udd/ddecotig/xgcc/host-sparc-solaris7/stow/gcc-3.1 --enable-long-long --enable-languages=c,c++ --disable-nls --disable-shared --with-as=/udd/ddecotig/xgcc/host-sparc-solaris7/bin/i586-gnu-as --with-gnu-as --with-ld=/udd/ddecotig/xgcc/host-sparc-solaris7/bin/i586-gnu-ld --with-gnu-ld --host=sparc-sun-solaris2.7 -v i586-gnu

When defining variables/functions sections using __attribute__, gcc
becomes very subtle : it refuses to put two slightly different
variables (incompatible ?) in the same section => "X causes a section
type conflict". It worked perfectly well with gcc-3.0.

I may be wrong in using the section __attribute__, but the doc does
not tell how to correctly specify a type for a section at compile
time (should I switch to "asm" directly ?).


Example 1:

/* "BUG" (?) : "p causes a section type conflict"
   remove the 'const' before int i, and it works */
const int *p __attribute__((section("foo")));
const int i __attribute__((section("foo"))) = 0;

Example 2:
/* "BUG" (?) : "bar causes a section type conflict"
   remove the f definition and it works */
__attribute__((section("foo"))) int bar[3];
__attribute__((section("foo"))) void f() {}
/* Or:
  void f(void) __attribute__((section("foo")));
  void f(void) {}


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