This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/39456] Functions/variables of a file in different named sections
- From: "etienne_lorrain at yahoo dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Jan 2012 09:53:59 +0000
- Subject: [Bug middle-end/39456] Functions/variables of a file in different named sections
- Auto-submitted: auto-generated
- References: <bug-39456-4@http.gcc.gnu.org/bugzilla/>
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...