Global symbol prefixes

Jan Tlatlik
Thu Mar 28 16:34:00 GMT 2013

Hey there,

I need a few directions:

I'm porting GAS to my architecture and I'm stuck with global symbol
Since my register operands are not prefixed (e.g. r23 instead of  %r23),
I need to prefix global symbols to avoid name collisions.
How do I tell GAS to recognize this prefix?

If I try to assemble

    .global %main

I am getting errors like
> example.s:1: Error: expected symbol name
> example.s:2: Error: junk at end of line, first unrecognized character
is `%'

The symbol names in the object file though must not have the prefix. It
is only needed at assembly time to solve the name collision problem.

I looked through a few existing ports, but none of them seem to do it
this way. Could anyone give me some advice how to do that?

Jan Tlatlik

More information about the Binutils mailing list