public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: J. William Campbell <jwilliamcampbell@comcast.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mpc83xx: Add -fpic relocation support
Date: Wed, 13 Oct 2010 00:21:35 -0700	[thread overview]
Message-ID: <4CB55DFF.5020708@comcast.net> (raw)
In-Reply-To: <4CB55209.2080803@free.fr>

  On 10/12/2010 11:30 PM, Albert ARIBAUD wrote:
> Le 12/10/2010 23:00, Joakim Tjernlund a ?crit :
>
>> Yes, but the difference isn't really the arch. It is the -mrelocatable
>> flag that is the big difference.
> Not only: obviously, implementing GOT relocation is not done the same on
> both archs, and it simply is not beneficial on ARM wrt PPC in terms of
> instructions. I did a pretty extensive run of tests with and without
> -fPIC and -fPIE on ARM, and GOT relocation clearly makes code bigger,
> whereas it does not PPC.
>
> This simply implies that -fPIC is a better choice for PPC (and hence
> -mrelocatable) while -fpie is a better one for ARM.
Hi All,
      In particular, the PPC takes two 32 bit instructions to load the 
known address of a variable into a register. If the GOT is used, a 
single 32 bit instruction can load the address of a variable from the 
GOT table (pointed to by a "fixed" register) into a register. In both 
cases, there are two memory cycles, but in the GOT case, only one 
instruction is required. This is why the GOT based code is smaller. 
However, the GOT cannot be used to address constants and some other 
items that are not "variables". I do think that -fPIC and -fpie are not 
mutually incompatible. On the PPC, the GOT references would be relocated 
in the loop that updates the GOT and the references to constants would 
be relocated by the ELF relocation code. That is how shared libraries 
are relocated.

Best Regards,
Bill Campbell

> Amicalement,

  parent reply	other threads:[~2010-10-13  7:21 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-12 12:38 [U-Boot] [PATCH] mpc83xx: Add -fpic relocation support Joakim Tjernlund
2010-10-12 12:52 ` Wolfgang Denk
2010-10-12 13:04   ` Joakim Tjernlund
2010-10-12 13:47     ` Wolfgang Denk
2010-10-12 14:10       ` Joakim Tjernlund
2010-10-12 17:31         ` Kim Phillips
2010-10-12 17:38           ` Scott Wood
2010-10-12 17:41           ` Joakim Tjernlund
2010-10-12 18:19             ` Kim Phillips
2010-10-12 18:25               ` Scott Wood
2010-10-12 18:38                 ` Kim Phillips
2010-10-12 19:09                 ` Joakim Tjernlund
2010-10-12 19:17                   ` Joakim Tjernlund
2010-10-12 19:54                     ` Kim Phillips
2010-10-12 21:23                       ` Joakim Tjernlund
2010-10-12 21:30                         ` Scott Wood
2010-10-13  9:44                       ` Joakim Tjernlund
2010-10-12 19:13               ` Joakim Tjernlund
2010-10-12 19:20                 ` Scott Wood
2010-10-12 19:51                   ` Joakim Tjernlund
2010-10-12 20:16                     ` Scott Wood
2010-10-12 20:40                       ` Joakim Tjernlund
2010-10-12 20:48                         ` Scott Wood
2010-10-12 21:06                           ` Joakim Tjernlund
2010-10-12 15:52     ` Scott Wood
2010-10-12 17:11       ` Joakim Tjernlund
2010-10-12 17:41         ` Albert ARIBAUD
2010-10-12 18:11           ` Joakim Tjernlund
2010-10-12 20:37             ` Albert ARIBAUD
2010-10-12 21:00               ` Joakim Tjernlund
2010-10-13  6:30                 ` Albert ARIBAUD
2010-10-13  7:07                   ` Joakim Tjernlund
2010-10-13  9:05                     ` Albert ARIBAUD
2010-10-13  9:34                       ` Joakim Tjernlund
2010-10-13 21:25                         ` Joakim Tjernlund
2010-10-14  6:25                           ` Albert ARIBAUD
2010-10-13  7:21                   ` J. William Campbell [this message]
2010-10-13  8:37                     ` Joakim Tjernlund
2010-10-12 17:37       ` Wolfgang Denk
2010-10-13  9:41 ` [U-Boot] [PATCHv2] " Joakim Tjernlund
2010-10-13 21:11   ` [U-Boot] [PATCHv3] " Joakim Tjernlund
2010-10-20  6:32     ` Joakim Tjernlund
2010-10-28  8:46       ` Joakim Tjernlund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CB55DFF.5020708@comcast.net \
    --to=jwilliamcampbell@comcast.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox