This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: equating symbols to undefined
On Fri, Oct 14, 2005 at 11:58:43AM -0700, H. J. Lu wrote:
> On Fri, Oct 14, 2005 at 11:54:22AM -0700, H. J. Lu wrote:
> > On Fri, Oct 14, 2005 at 08:25:29PM +0200, Jan Beulich wrote:
> > > In what way does the sample sent not meet this? It matches exactly the
> > > real situation that I having the problem with, only that I added the
> > > __asm__(".global ..."); to show that making the symbol global doesn't
> > > help. I specifically made that part contitional on a manifest constant,
> > > so you can easily compare the two and see that making the symbol global
> > > introduces a new problem, whereas not making the symbol global causes an
> >
> > Can you tell me what the new problem is? I got
> >
> > [hjl@gnu-13 alias]$ make
> > cc -c -o alias.o -save-temps alias.c
> > cc -c -o main.o -save-temps main.c
> > cc -c -o normal.o -save-temps normal.c
> > cc -c -o user.o -save-temps user.c
> > cc -o tst alias.o main.o normal.o user.o
> > ./tst
> > copymem(0x500c00, 0x400700, 400)
> > copymem(0x500c00, 0x400700, 400)
> >
> > I expect "make" fails if there is a problem.
> >
>
> Never mind. I figured it out.
Why does alias.c have to include alias.h? Specially, why does alias.c
have to have
__asm__(".equiv memcpy, copymem");
To the least, it defines an unused symbol, memcpy. I don't see the
current assembler can't accomplish the same end result as the old one,
albeit you may need slightly differrent source.
FWIW, ".alias" is better suited for this purpose.
H.J.