From patchwork Thu Aug 5 14:40:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 60976 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 7BBFFB6EE8 for ; Fri, 6 Aug 2010 00:41:29 +1000 (EST) Received: (qmail 12827 invoked by alias); 5 Aug 2010 14:41:26 -0000 Received: (qmail 12817 invoked by uid 22791); 5 Aug 2010 14:41:25 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-pz0-f47.google.com (HELO mail-pz0-f47.google.com) (209.85.210.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Aug 2010 14:41:18 +0000 Received: by pzk2 with SMTP id 2so2524613pzk.20 for ; Thu, 05 Aug 2010 07:41:16 -0700 (PDT) Received: by 10.114.13.2 with SMTP id 2mr12374993wam.155.1281019264848; Thu, 05 Aug 2010 07:41:04 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id q6sm494952waj.22.2010.08.05.07.41.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 05 Aug 2010 07:41:04 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 3539F170C1FA; Fri, 6 Aug 2010 00:10:51 +0930 (CST) Date: Fri, 6 Aug 2010 00:10:51 +0930 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: David Edelsohn Subject: [PowerPC] Improve -mrelocatable doc Message-ID: <20100805144051.GS31102@bubble.grove.modra.org> Mail-Followup-To: gcc-patches@gcc.gnu.org, David Edelsohn MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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. 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