diff mbox

[PowerPC] Improve -mrelocatable doc

Message ID 20100805144051.GS31102@bubble.grove.modra.org
State New
Headers show

Commit Message

Alan Modra Aug. 5, 2010, 2:40 p.m. UTC
This provides some detail on code generated by the PowerPC
-mrelocatable option.  OK to apply?

	* doc/invoke.texi (RS/6000 and PowerPC Options): Rewrite -mrelocatable
	and -mrelocatable-lib description.

Comments

David Edelsohn Aug. 5, 2010, 9:19 p.m. UTC | #1
On Thu, Aug 5, 2010 at 10:40 AM, Alan Modra <amodra@gmail.com> wrote:
> This provides some detail on code generated by the PowerPC
> -mrelocatable option.  OK to apply?
>
>        * doc/invoke.texi (RS/6000 and PowerPC Options): Rewrite -mrelocatable
>        and -mrelocatable-lib description.

Okay.

Thanks, David
diff mbox

Patch

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 162841)
+++ gcc/doc/invoke.texi	(working copy)
@@ -15412,20 +15412,25 @@  unaligned memory references will be hand
 @itemx -mno-relocatable
 @opindex mrelocatable
 @opindex mno-relocatable
-On embedded PowerPC systems generate code that allows (does not allow)
-the program to be relocated to a different address at runtime.  If you
-use @option{-mrelocatable} on any module, all objects linked together must
-be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
+Generate code that allows (does not allow) a static executable to be
+relocated to a different address at runtime.  A simple embedded
+PowerPC system loader should relocate the entire contents of
+@code{.got2} and 4-byte locations listed in the @code{.fixup} section,
+a table of 32-bit addresses generated by this option.  For this to
+work, all objects linked together must be compiled with
+@option{-mrelocatable} or @option{-mrelocatable-lib}.
+@option{-mrelocatable} code aligns the stack to an 8 byte boundary.
 
 @item -mrelocatable-lib
 @itemx -mno-relocatable-lib
 @opindex mrelocatable-lib
 @opindex mno-relocatable-lib
-On embedded PowerPC systems generate code that allows (does not allow)
-the program to be relocated to a different address at runtime.  Modules
-compiled with @option{-mrelocatable-lib} can be linked with either modules
-compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
-with modules compiled with the @option{-mrelocatable} options.
+Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
+@code{.fixup} section to allow static executables to be relocated at
+runtime, but @option{-mrelocatable-lib} does not use the smaller stack
+alignment of @option{-mrelocatable}.  Objects compiled with
+@option{-mrelocatable-lib} may be linked with objects compiled with
+any combination of the @option{-mrelocatable} options.
 
 @item -mno-toc
 @itemx -mtoc