This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Add MIPS -mno-shared support
- From: Ian Lance Taylor <ian at airs dot com>
- To: Richard Sandiford <richard at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, echristo at apple dot com, ths at networkno dot de, macro at linux-mips dot org
- Date: 21 Mar 2006 14:21:21 -0800
- Subject: Re: Add MIPS -mno-shared support
- References: <8764m7sbys.fsf@talisman.home>
Richard Sandiford <richard@codesourcery.com> writes:
> This patch adds -mno-shared support to gcc, to match the gas support that
> Ian Lance Taylor added a while back. (This has been on my to-do list for
> a very long time.)
Thanks for doing this. It's been on my TODO list as well (#5 at the
moment) but I never got around to it. Your patch is better than mine,
anyhow.
> +@item -mshared
> +@itemx -mno-shared
> +Generate (do not generate) code that is fully position-independent.
> +This option only affects @option{-mabicalls}.
> +
> +All @option{-mabicalls} code has traditionally been position-independent,
> +regardless of options like @option{-fPIC} and @option{-fpic}. However,
> +as an extension, the GNU toolchain allows executables to use absolute
> +accesses for locally-binding symbols. It can also use shorter GP
> +initialization sequences and generate direct calls to locally-defined
> +functions. This mode is selected by @option{-mno-shared}.
> +
> +@option{-mno-shared} depends on binutils 2.16 or higher and generates
> +objects that can only be linked by the GNU linker. However, the option
> +does not affect the ABI of the final executable; it only affects the ABI
> +of relocatable objects. Using @option{-mno-shared} will generally make
> +executables both smaller and quicker.
> +
> +@option{-mshared} is the default.
Maybe this doc could be a little more specific in saying that code
compiled with -mno-shared can not be put into a shared library, for
people who don't quite make the connection from "position-independent"
to "shared library."
Ian