This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

[Bug middle-end/39456] Functions/variables of a file in different named sections


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39456

--- Comment #4 from etienne_lorrain at yahoo dot fr 2012-01-03 09:53:59 UTC ---
Thanks for looking at my reports and happy new year!

I think the problem I had was the quoting and string concat, you need:
void fct2 (void) __attribute__((__section__("sect1_fct2"))) { return; }

The solution you give generates:
void fct1 (void) __attribute__((__section__(basesectfct1))) { return; }

You cannot give the compiler:
void fct2 (void) __attribute__((__section__("sect1_" "fct2"))) { return; }
because it would not concat the strings in this case (I did not re-check).

And:
#define function_def(base_section, funname, RET, ARGS) \
RET funname ARGS __attribute__((__section__(# base_section##funname)))
#define basesect sect1_
function_def(basesect, fct1, void, (void)) { return; }
will stringify #base_section before applying the ##

That was my problem...


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