public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: Jakub Jelinek <jakub@redhat.com>, "H.J. Lu" <hjl.tools@gmail.com>,
	       Jan Beulich <JBeulich@novell.com>,
	GCC Development <gcc@gcc.gnu.org>,
	       x32-abi@googlegroups.com,
	Binutils <binutils@sourceware.org>,
	       GNU C Library <libc-alpha@sourceware.org>
Subject: Re: x32 psABI draft version 0.2
Date: Thu, 17 Feb 2011 23:00:00 -0000	[thread overview]
Message-ID: <4D5DA868.1050905@zytor.com> (raw)
In-Reply-To: <20110217224956.GA20055@kam.mff.cuni.cz>

On 02/17/2011 02:49 PM, Jan Hubicka wrote:
>> On Thu, Feb 17, 2011 at 04:44:53PM +0100, Jan Hubicka wrote:
>>>>> According to Mozilla folks however REL+RELA scheme used by EABI leads
>>>>> to significandly smaller libxul.so size
>>>>>
>>>>> According to http://glandium.org/blog/?p=1177 the difference is about 4-5MB
>>>>> (out of approximately 20-30MB shared lib)
>>>>
>>>> This is orthogonal to x32 psABI.
>>>
>>> Understood.  I am just pointing out that x86-64 Mozilla suffers from startup
>>> problems (extra 5MB of disk read needed) compared to both x86 and ARM EABI
>>> because x86-64 ABI is RELA only. If x86-64 ABI was REL+RELA like EABI is, we
>>> would not have this problem here.
>>
>> libxul.so has < 200000 relocs, so 5MB is total size of .rela section in
>> 64-bit ELF, you don't magically save those 5MB by using REL.  You save
>> just 1.5MB.  And for x32 we'd be talking about 2.5MB for RELA vs. 1.6MB for
> 
> The blog claims
> Architecture 	libxul.so size 	relocations size 	%
> x86 	21,869,684 	1,884,864 	8.61%
> x86-64 	29,629,040 	5,751,984 	19.41%
> 
> The REL encoding also grows twice for 64bit target?
> 

REL would be twice the size for a 64-bit target (which x32 is not, from
an ELF point of view).  Keep in mind that REL cannot do error handing
very well, especially not on a 64-bit platform.

Elf32_Rel:	 8 bytes
Elf32_Rela:	12 bytes
Elf64_Rel:	16 bytes
Elf64_Rela:	24 bytes

So 1,884,864 to 5,751,984 indicates a (very) small increase in
relocation count, the exactly equivalent numbers would be:

Elf32_Rel:	1,884,864 bytes
Elf32_Rela:	2,827,296 bytes
Elf64_Rel:	3,769,728 bytes
Elf64_Rela:	5,654,592 bytes

	-hpa

  reply	other threads:[~2011-02-17 23:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 19:22 H.J. Lu
2011-02-16 20:04 ` H. Peter Anvin
2011-02-16 20:29   ` Roland McGrath
2011-02-16 20:35   ` Chris Metcalf
2011-02-16 20:39     ` Andrew Pinski
2011-02-16 20:46       ` H.J. Lu
2011-02-16 22:13         ` Chris Metcalf
2011-02-17  8:35   ` Jan Beulich
2011-02-17 12:14     ` H.J. Lu
2011-02-17 16:14       ` John Reiser
2011-02-17 17:59         ` Jakub Jelinek
2011-02-17 14:29     ` Jakub Jelinek
2011-02-17 15:22       ` Jan Hubicka
2011-02-17 15:30         ` H.J. Lu
2011-02-17 15:45           ` Jan Hubicka
2011-02-17 15:49             ` H.J. Lu
2011-02-17 16:10               ` Jan Beulich
2011-02-17 17:59                 ` H.J. Lu
2011-02-18  8:10                   ` Jan Beulich
2011-02-18 17:53                     ` H.J. Lu
2011-02-18 20:32                       ` Jan Hubicka
2011-02-21  8:04                       ` Jan Beulich
2011-02-17 18:07             ` Jakub Jelinek
2011-02-17 19:56               ` H. Peter Anvin
2011-02-17 22:50               ` Jan Hubicka
2011-02-17 23:00                 ` H. Peter Anvin [this message]
2011-02-17 23:07                 ` Jakub Jelinek
2011-02-18  8:49                   ` Jan Beulich
2011-02-17 18:14         ` Joseph S. Myers

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=4D5DA868.1050905@zytor.com \
    --to=hpa@zytor.com \
    --cc=JBeulich@novell.com \
    --cc=binutils@sourceware.org \
    --cc=gcc@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=hubicka@ucw.cz \
    --cc=jakub@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=x32-abi@googlegroups.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).