This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ld -defsym option
- From: Fabio Alemagna <falemagn at studenti dot unina dot it>
- To: S kris <kris_bs at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org, <help-make at gnu dot org>, <kernelnewbies at nl dot linux dot org>
- Date: Tue, 8 Jul 2003 14:09:56 +0200 (CEST)
- Subject: Re: ld -defsym option
On Tue, 8 Jul 2003, S kris wrote:
> Hi,
>
> I am trying to link the x.o and sample.a (contains y.o) using ld for
> creating executable. I have used -defsym xsymbol=ysymbol as the linker
> option for changing the symbol "xsymbol" defined in x.c to the symbol
> "ysymbol" defined in y.c. But i get the error "Undefined symbol
> 'ysymbol' referenced in x.o". What may be the reason for this error? Is
> this something to do with archive?
>
> Please help me in fixing this?
Symbol names have to be specified using the same mangling as they have in
the compiler's asm output. The m68k port of gcc puts a '_' before every
symbol's name, hence you should use -defsym _xsymbol=_ysymbol.
Fabio Alemagna