From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2] arm: config: enforce -fno-pic for gcc
Date: Sat, 30 Jan 2016 09:59:52 -0500 [thread overview]
Message-ID: <20160130145952.GJ27374@bill-the-cat> (raw)
In-Reply-To: <1454127049-4851-1-git-send-email-peng.fan@nxp.com>
On Sat, Jan 30, 2016 at 12:10:49PM +0800, Peng Fan wrote:
> Android's tool chain enable the -mandroid at default.
> This option will enable the -fpic, which cause uboot compilation
> failure:
> "
> LD u-boot
> u-boot contains unexpected relocations: R_ARM_ABS32
> R_ARM_RELATIVE
> "
>
> In my testcase, arm-linux-androideabi-gcc-4.9 internally
> enables '-fpic', so when compiling code, there will be
> relocation entries using type R_ARM_GOT_BREL and .got
> section. When linking all the built-in.o using ld, there
> will be R_ARM_ABS32 relocation entry and .got section
> in the final u-boot elf image. This can not be handled
> by u-boot, since u-boot only expects R_ARM_RELATIVE
> relocation entry.
> arm-poky-linux-gnueabi-gcc-4.9 default does not enable '-fpic',
> so there is not .got section and R_ARM_GOT_BREL in built-in.o.
> And in the final u-boot elf image, all relocation entries are
> R_ARM_RELATIVE.
>
> we can pass '-fno-pic' to xxx-gcc to disable pic. whether
> the toolchain internally enables or disables pic, '-fno-pic'
> can work well.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160130/07823740/attachment.sig>
next prev parent reply other threads:[~2016-01-30 14:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-30 4:10 [U-Boot] [PATCH V2] arm: config: enforce -fno-pic for gcc Peng Fan
2016-01-30 14:59 ` Tom Rini [this message]
2016-01-31 15:30 ` Albert ARIBAUD
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=20160130145952.GJ27374@bill-the-cat \
--to=trini@konsulko.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