public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jason Harris <jason.harris@motorolasolutions.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [u-boot-mips] gp init and -pie option
Date: Fri, 17 May 2013 23:01:52 +0000 (UTC)	[thread overview]
Message-ID: <loom.20130518T005634-193@post.gmane.org> (raw)
In-Reply-To: CACUy@mail.gmail.com








Daniel Schwierzeck <daniel.schwierzeck <at> gmail.com> writes:

> 
> Hi,
> 
> 2013/2/26 Juhyun (Justin) Oh <Juhyun_Oh <at> sigmadesigns.com>:
> > HI Daniel,
> >
> > I'm using CodeSourcery 4.5.2. I've configured and have built the code 
for "incaip" board and "dbau1000".
> The results are the same. (i.e. gp has been set with wrong value)
> >
> > Could you tell me the CodeSourcery toolchain versions known to be 
working? I'd like to try out the same version.
> >
> Which CodeSourcery release do you use?
> 
> I have tried following toolchains and all of them have _gp initialized
> correctly.
> 
> Sourcery CodeBench Lite 2011.09-75
>   gcc version 4.5.2 (Sourcery CodeBench Lite 2011.09-75)
>   GNU ld (Sourcery CodeBench Lite 2011.09-75) 2.21.53.20110905
> 
> Sourcery CodeBench Lite 2012.03-63:
>   gcc version 4.6.3 (Sourcery CodeBench Lite 2012.03-63)
>   GNU ld (Sourcery CodeBench Lite 2012.03-63) 2.21.53.20110905
> 
> ELDK-5.2.1:
>   gcc version 4.6.4 20120303 (prerelease) (GCC)
>   GNU ld (GNU Binutils) 2.22
> 
> ELDK-5.3:
>   gcc version 4.7.2 (GCC)
>   GNU ld (GNU Binutils) 2.22
> 


mips-u24kc-linux-gnu-ld --version
GNU ld (GNU Binutils) 2.18

--help ....

  -pie, --pic-executable      Create a position independent executable

I've observed:

with -pie:

800004c0 04110002: bgezal  r0, 0x2L (=2) -> 0x00000000800004cc
800004c4 00000000: nop
800004c8 00000000: nop
800004cc 8ffc0000: lw      r28, 0x0L (=0) (r31)

wrong: _gp = 0

with --pic-executable:

800004c0 04110002: bgezal  r0, 0x2L (=2) -> 0x00000000800004cc
800004c4 00000000: nop
800004c8 800372c0: lb      r3, 0x72c0L (=29376) (r0)
800004cc 8ffc0000: lw      r28, 0x0L (=0) (r31)

correct: _gp = 800372c0

Looks like something is wrong with option processing on ld.

  parent reply	other threads:[~2013-05-17 23:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 19:53 [U-Boot] [u-boot-mips] gp init and -pie option Juhyun Oh
2013-02-26  9:52 ` Daniel Schwierzeck
2013-02-26 18:12   ` Juhyun Oh
2013-02-26 19:44     ` Michael Cashwell
2013-02-26 19:54       ` Juhyun Oh
2013-02-26 20:34     ` Daniel Schwierzeck
2013-02-26 21:49       ` Juhyun Oh
     [not found]     ` <CACUy@mail.gmail.com>
2013-05-17 23:01       ` Jason Harris [this message]
2013-05-22 23:53         ` Jason Harris

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=loom.20130518T005634-193@post.gmane.org \
    --to=jason.harris@motorolasolutions.com \
    --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