All of lore.kernel.org
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] ARM: problem with linker option -pie
Date: Sun, 31 Oct 2010 11:57:24 +0100	[thread overview]
Message-ID: <4CCD4B94.90402@free.fr> (raw)
In-Reply-To: <20101031103508.A5BDD1522C0@gemini.denx.de>

Le 31/10/2010 11:35, Wolfgang Denk a ?crit :
> Dear Albert ARIBAUD,
>
> In message<4CCD3A6F.7040303@free.fr>  you wrote:
>>
>> The first test I did with a sample program which contains the three
>> types of static scope objects: const, initialized and uninitialized, and
>> I checked that the inititialized one lands in BSS which has NOBITS while
>> explicitely initialized objects land in data sections with PROGBITS --
>> that's akin to the LOAD attribute.
>
> Thanks for checking.
>
>> Both the ELDK 4.2 and the CS toolchains' linkers treat all three object
>> types the same way with respect to relocation, and emit relocations to
>> the uninitialized object, so not having LOAD attribute is irrelevant --
>> BTW if it was, BSS relocation would never have worked.
>
> Yes, I know. My speculation was that suchbehaviour (or linker options
> to adjust it) might have changed in more recent versions of
> gcc/binutils.

Understood. Apparently it hasn't as such.

> BTW: I would like to point out that so far we're blaming GCC, which is
> not exaclt correct, as we always tested GCC+Binutils combos. For
> completeness, we should separate compilation and linking and test for
> example ELDK's gcc with CS's ld, and vice versa.  Hope I will find
> some time later this night.  Hope the ghosts won't make too much of a
> noise.

Correct, gcc and binutils are different things. In my (admittedly 
simple) test I'd looked at both toe .o files and the elf binaries, so 
either stage seems ok; and you're correct that 'cross-building' one gcc 
with the other linker is a useful set of tests to perform.

For the sake of completeness, as a reminder, the -pie option is a pure 
linker option: the gcc stage is the same whether ELF relocation is 
generated or not; that would *slightly* weight toward the linker as a 
culprit, but let's not haste to conclusions especially with such a weird 
issue.

I'll try 'cross-building' either this morning or in the early afternoon.

> Best regards,
>
> Wolfgang Denk

Amicalement,
-- 
Albert.

  reply	other threads:[~2010-10-31 10:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-30 20:37 [U-Boot] ARM: problem with linker option -pie Darius Augulis
2010-10-30 20:43 ` Wolfgang Denk
2010-10-30 20:53   ` Darius Augulis
2010-10-30 21:17     ` Wolfgang Denk
2010-10-30 21:42       ` Albert ARIBAUD
2010-10-30 23:31         ` Albert ARIBAUD
2010-10-31  8:20           ` Albert ARIBAUD
2010-10-31  8:40             ` Reinhard Meyer
2010-10-31  8:51               ` Albert ARIBAUD
2010-10-31  9:25               ` Wolfgang Denk
2010-10-31  9:24             ` Wolfgang Denk
2010-10-31  9:44               ` Albert ARIBAUD
2010-10-31 10:35                 ` Wolfgang Denk
2010-10-31 10:57                   ` Albert ARIBAUD [this message]
2010-10-31 11:30                     ` Albert ARIBAUD
2010-10-31 11:31                       ` Albert ARIBAUD
2010-10-31 13:29                       ` Albert ARIBAUD
2010-10-31 17:38       ` Darius Augulis
2010-10-31  7:46 ` Heiko Schocher

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=4CCD4B94.90402@free.fr \
    --to=albert.aribaud@free.fr \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.