A very "strange" bug in gcc 2.96
Alan Modra
alan@linuxcare.com.au
Sun May 21 19:01:00 GMT 2000
On 21 May 2000, Eric W. Biederman wrote:
> "H . J . Lu" <hjl@lucon.org> writes:
>
> > There is the ia32 asm ouput from gcc 2.96 with -O2. Please notice that
> >
> > jmp foo
> >
> > is generated, instead of
> >
> > call foo
> > leave
> > ret
> >
> > It is ok if foo () is a static function. But for extern, they are
> > not the same. The GNU linker supports shared libraries even without
> > -fPIC. With "jmp foo", it doesn't work anymore. If it is intentional,
> > we should declare PIC is required for building shared libraries.
> > Personally, I don't like compiler does this behind my back. It took
> > me several days to figure out why things stopped working.
> >
> > Thanks.
>
> What would need to change with gnu as and gnu ld to cause this to work?
> Is it simply that as needs to emit a location record when jumping
> to labels declared .globl?
For x86, gas/config/tc-i386.c:md_estimate_size_before_relax needs to be
taught how to handle this case properly. (I think that's all that's
needed...)
--
Linuxcare. Support for the Revolution.
More information about the Binutils
mailing list