This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: A very "strange" bug in gcc 2.96
- To: "H . J . Lu" <hjl at lucon dot org>
- Subject: Re: A very "strange" bug in gcc 2.96
- From: eric at biederman dot org (Eric W. Biederman)
- Date: 21 May 2000 17:18:36 -0500
- Cc: egcs at egcs dot cygnus dot com, binutils at sourceware dot cygnus dot com
- References: <20000521115908.A8267@lucon.org>
"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?
Or do we need to emit a special variant of the jmp instruction to cause
gnu as to do the right thing? (yuck...)
In scheme this optimization is required, so it would be worth figuring
out how to do safely.
Eric