From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC] [PATCH V2] arm: arm926ejs: use ELF relocations
Date: Tue, 05 Oct 2010 10:32:17 +0200 [thread overview]
Message-ID: <4CAAE291.3000301@free.fr> (raw)
In-Reply-To: <4CAAD665.5090500@denx.de>
Le 05/10/2010 09:40, Heiko Schocher a ?crit :
> Hello Albert,
>
> Albert Aribaud wrote:
>> HISTORY:
>>
>> V1 Initial patch
>> V2 Rebased on latest mainline master
>>
>> This patch is *not* a submission for master!
>>
>> It is a proof of concept of ELF relocations for ARM, hastily done
>> in a day's work time for people on the list to try and to comment.
>> All comments are welcome, as several suggestions have been made
>> today on the list that I did not have time to incorporate, such as
>> rewriting the elf table fixup code in C.
>>
>> The basic idea of this patch is to replace the -fPIC compile-time
>> option with the -pie link-time option. This removes the GOT but adds
>> the .rel.dyn and .dynsym tables, which together allow fixing up code
>> more completely than with -fPIC and the GOT; for instance, all pointers
>> inside structures are fixed up with -pie, whereas they are not with GOT.
>>
>> Note that references to linker-file-generated symbols were also made
>> relative to _start rather than absolute. This is not needed as such,
>> but it will be useful when optimizing the relocation tables. Actually
>> I should have separated this from the ELF relocation support per se.
>>
>> The edminiv2.h config file is there for reference only; this is the
>> one I used for tests. Latest numbers are:
>>
>> With GOT relocs:
>>
>> text data bss dec hex filename .bin size
>> 141376 4388 16640 162404 27a64 ./u-boot 145764
>>
>> With ELF relocs:
>>
>> text data bss dec hex filename .bin size
>> 149677 3727 16636 170040 29838 ./u-boot 153408
>>
>> The size difference is essentially due to .rel.dyn not being optimal.
>> As discussed, an added build step should allow reducing it by half and
>> making ELF sizes roughly similar to GOT ones.
>>
>> Tests and comments not only welcome but also heartily called for.
>
> Tested based on your patch on the magnesium board (ARM926ejs and
> boots from NOR Flash). U-Boot works, with the following patch:
>
> ! I had to set TEXT_BASE to 0xc0000000 as u-boot starts from there,
> a TEXT_BASE = 0 didn;t work for me!
Seems like an overlook from me, it should not be 0.
I'll change thant in the next version.
Thanks for testing!
Amicalement,
--
Albert.
next prev parent reply other threads:[~2010-10-05 8:32 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 6:31 [U-Boot] [RFC] [PATCH V2] arm: arm926ejs: use ELF relocations Albert Aribaud
2010-10-05 6:45 ` Wolfgang Denk
2010-10-05 7:05 ` Reinhard Meyer
2010-10-05 7:23 ` Reinhard Meyer
2010-10-05 7:52 ` Reinhard Meyer
2010-10-05 8:33 ` Heiko Schocher
2010-10-05 8:41 ` Albert ARIBAUD
2010-10-05 9:00 ` Heiko Schocher
2010-10-05 9:10 ` Reinhard Meyer
2010-10-05 9:15 ` Heiko Schocher
2010-10-05 9:19 ` Reinhard Meyer
2010-10-05 9:29 ` Heiko Schocher
2010-10-05 9:33 ` Reinhard Meyer
2010-10-05 9:39 ` Reinhard Meyer
2010-10-05 10:11 ` Albert ARIBAUD
2010-10-05 10:36 ` Reinhard Meyer
2010-10-05 10:49 ` Graeme Russ
2010-10-05 11:01 ` Reinhard Meyer
2010-10-05 11:18 ` Albert ARIBAUD
2010-10-05 10:33 ` Albert ARIBAUD
2010-10-05 10:40 ` Wolfgang Denk
2010-10-05 11:10 ` Albert ARIBAUD
2010-10-05 11:17 ` Reinhard Meyer
2010-10-05 11:46 ` Albert ARIBAUD
2010-10-05 13:18 ` Reinhard Meyer
2010-10-05 13:24 ` Graeme Russ
2010-10-05 13:36 ` Albert ARIBAUD
2010-10-05 14:06 ` Reinhard Meyer
2010-10-05 11:43 ` Wolfgang Denk
2010-10-05 10:20 ` Albert ARIBAUD
2010-10-05 8:27 ` Wolfgang Denk
2010-10-05 8:38 ` Reinhard Meyer
2010-10-05 8:50 ` Albert ARIBAUD
2010-10-05 8:59 ` Reinhard Meyer
2010-10-05 7:07 ` Wolfgang Denk
2010-10-05 7:40 ` Heiko Schocher
2010-10-05 8:32 ` Albert ARIBAUD [this message]
2010-10-05 8:02 ` Wolfgang Denk
2010-10-05 9:25 ` Heiko Schocher
2010-10-05 9:32 ` Albert ARIBAUD
2010-10-05 12:07 ` Heiko Schocher
2010-10-05 12:52 ` 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=4CAAE291.3000301@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox