This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add MIPS -mno-shared support


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]