This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Strange PIC code on ia32 since Aug. 29.
On Fri, Sep 01, 2000 at 11:38:04PM -0300, Alexandre Oliva wrote:
> On Sep 1, 2000, "H . J . Lu" <hjl@valinux.com> wrote:
>
> > call bar@PLT
>
> > It doesn't look like PIC code at all.
>
> Why not? IIRC, both `call' and `@PLT' are PC-relative on ia32.
>
You can do one of 2 things:
1. Get ia32 psABI from
http://www.sco.com/developer/devspecs/
2. Use gcc 2.95.2, egcs 1.1.2 or gcc 2.7.2.3.
Study psABI says about PIC and what the previous gcc generates. I am
enlosing the correct asm output here. gcc shouldn't output some random
asm code and call it PIC. Did you see the difference?
H.J.
----
.file "p.c"
.version "01.01"
gcc2_compiled.:
.text
.align 4
.globl foo
.type foo,@function
foo:
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %eax
call .L3
.L3:
popl %ebx
addl $_GLOBAL_OFFSET_TABLE_+[.-.L3], %ebx
call bar@PLT
movl -4(%ebp), %ebx
leave
ret
.Lfe1:
.size foo,.Lfe1-foo
.ident "GCC: (GNU) 2.96 20000731 (experimental)"