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: LTO vs. default section alignment vs. relocatable links.


On 01/02/2011 21:55, Alan Modra wrote:
> On Tue, Feb 01, 2011 at 09:44:51PM +0000, Dave Korn wrote:
>>     Hi all,
>>
>>   LTO IR sections need to have 1-byte alignment, and that is how we get them
>> from GAS.  So far so good, but when we do a -r link of two object files, the
>> placement of the LTO sections is handle by orphan handling, since there aren't
>> any LTO section output statements in any of the default linker scripts (yet).
>>
>>   In practice, this leads (at least on i686-pc-cygwin) to the sections being
>> placed after .rodata, and they get the default section alignment.  That causes
>> their sizes to be rounded up to 4 with padding, which fatally confuses the
>> zlib decompressor in lto1 when we come to stream them back in later.
> 
> This is a PE specific problem, isnt it?
> 
>       /* All sections in an executable must be aligned to a page boundary.  */
>       address = exp_unop (ALIGN_K, exp_nameop (NAME, "__section_alignment__"));
>       os = lang_insert_orphan (s, secname, constraint, after, place, address,
> 			       &add_child);
> 
> Fixable right there..

  That's where I was looking, but I didn't know if ELF wouldn't also do the
same thing.  Since HJ says it doesn't, that's definitely the right place to
fix it.

    cheers,
      DaveK


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