This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: x32 psABI draft version 0.2


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]