Mail Archives: djgpp/1996/06/11/08:09:51
>
> Brian Drum <drum AT ix DOT netcom DOT com> writes:
>
> >For eaxample:
>
> >void foo(int x) {
> > __asm__ __volatile__ ("
> > movl _x, %%eax"
> > :
> > :
> > :"eax" );
> >}
>
> >Won't work. I get the following linker error:
> >test_asm.c(.text+0x4): undefined reference to `x'
I would think that's because your x parameter is not a static location in
memory but a place on the stack, but _x refers to a static location in memory.
(ie if you had static int x; it would work) Thus, gas assembles it wrong.
Sengan
- Raw text -