bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gas: i386 leal _GLOBAL_OFFSET_TABLE_


From: Kevin Ryde
Subject: Re: gas: i386 leal _GLOBAL_OFFSET_TABLE_
Date: 11 May 2001 07:30:53 +1000
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.5

Ian Lance Taylor <address@hidden> writes:
> 
> The question is whether it links correctly.  If the linker produces
> the desired output, then the assembler output is most likely correct.

I think the linker ends up producing the wrong results.  That's been
my experience with a couple of actual programs.  Or the little test
program below, compiled and run with

        gcc -shared foo.s -o libfoo.so
        gcc main.c -L. -lfoo
        LD_LIBRARY_PATH=. ./a.out

produces, for me,

        with ebx: 0x40018708
        with eax: 0x40018709
        with lea: 0x40018706

If _GLOBAL_OFFSET_TABLE_ refers to the start of the instruction it
appears in, which is how I understand it, then all three should be the
same (the ebx one is correct, I think).  Certainly, for comparison,
that's how it is on solaris 8 with gcc but the native as and ld.

Attachment: main.c
Description: Text Data

Attachment: foo.s
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]