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


Ian Lance Taylor <ian@airs.com> writes:
> Richard Sandiford <richard@codesourcery.com> writes:
>> +@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."

Good point.  I originally avoided talking about shared libraries because
I thought that if we mentioned them, we should also explain the binding
differences between -mshared and -mshared -fpic, which would make the
docs even more complex than they are now.  However, I agree it's a bit
daft to avoid the word "shared" in the description of something called
"-mshared", so here's what I installed.

Richard

	* doc/md.texi (-mshared): Mention that -mshared code can be linked
	into shared libraries.

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 112279)
+++ gcc/doc/invoke.texi	(working copy)
@@ -10470,8 +10470,9 @@ systems.
 
 @item -mshared
 @itemx -mno-shared
-Generate (do not generate) code that is fully position-independent.
-This option only affects @option{-mabicalls}.
+Generate (do not generate) code that is fully position-independent,
+and that can therefore be linked into shared libraries.  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,


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