Modifying the LABEL for functions emitted by the GCC Compiler

Ravishankar S
Fri Sep 1 15:55:00 GMT 2006

Did you  try the --demangle linker option ? 
For more: info ld => and search. 


-----Original Message-----
From: [] On
Behalf Of Rohit Arul Raj
Sent: Friday, September 01, 2006 7:37 PM
Subject: Re: Modifying the LABEL for functions emitted by the GCC

Rohit Arul Raj wrote:

> The  gcc-coldfire compiler spits out the labels as it is in the 
> assembly file (main, printf etc), where  as the IDE compiler spits out

> the labels prefixed with a  '_' (_main, _printf etc).
> Is there any way  i can  make gcc-coldfire compiler emit  the lables 
> prefixed with an underscore (' _ ').Can anyone Help me OUT of this 
> mess!!!
How about reconciling the -fleading-underscore options?

Yeah Thanks!!!

That works for the compiler.... But the problem is that how can i force
my linker to accept the labels with an '_'. If i link with an '_' prefix
i get the following error message <Error>
metro.o: In function `_main':
(.text+0xe): undefined reference to `_printf'
metro.o: In function `_main':
(.text+0x8): relocation truncated to fit: R_68K_16 against `_@7'
sim-crt0.o: In function `start':
sim-crt0.S:(.text+0x56): undefined reference to `main'
Is there any option available in the Linker part to get round this???


__________ NOD32 1.1454 (20060321) Information __________

This message was checked by NOD32 antivirus system.

More information about the Gcc-help mailing list