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: hjl at lucon dot org
- Subject: Re: A very "strange" bug in gcc 2.96
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Sun, 21 May 2000 12:31:56 -0700
- Cc: egcs at egcs dot cygnus dot com, binutils at sourceware dot cygnus dot com
- Organization: CodeSourcery, LLC
- References: <20000521115908.A8267@lucon.org>
>>>>> "H" == H J Lu <hjl@lucon.org> writes:
H> There is the ia32 asm ouput from gcc 2.96 with -O2. Please
H> notice that
H> jmp foo
H> is generated, instead of
H> call foo leave ret
This is presumably due to the new sibling call optimization.
Richard, Jeff: I would very much appreciate your comments on this
issue.
H> without -fPIC. With "jmp foo", it doesn't work anymore. If it
H> is intentional, we should declare PIC is required for building
H> shared libraries.
I think that using -fPIC should be required for building shared
libraries.
But, you are right that there is an issue here in that this does
change behavior relative to older versions of the compiler. Perhaps
someone could clarify this piece of documentation from the gcc info
pages:
`-shared'
Produce a shared object which can then be linked with other
objects to form an executable. Not all systems support this
option. You must also specify `-fpic' or `-fPIC' on some systems
when you specify this option.
as well as the descriptions of -fpic and -fPIC.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com