------- Comment #4 from fxcoudert at gcc dot gnu dot org 2007-01-18 17:28 ------- So, the reduced code looks like this:
extern void bar (void); extern __typeof(bar) bar __asm__("foo"); void bar (void) { ; } extern __typeof(bar) gee __attribute__((__alias__("foo"))); Ian Lance Taylor gave me the solution on IRC, which is: on SH, all symbol names are preprended an underscore, but in the above code __asm__("foo") does not prepend it for us. The macro defined for this underscore (and other such prefixes on other targets, although I don't any in particular) is __USER_LABEL_PREFIX__, so the final fix is: #define stringize(x) expand_macro(x) #define expand_macro(x) # x extern void bar (void); extern __typeof(bar) bar __asm__(stringize(__USER_LABEL_PREFIX__) "foo"); void bar (void) { ; } extern __typeof(bar) gee __attribute__((__alias__("foo"))); -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2007-01-05 10:10:35 |2007-01-18 17:28:42 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30007