This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: LTO vs. default section alignment vs. relocatable links.
- From: Alan Modra <amodra at gmail dot com>
- To: Dave Korn <dave dot korn dot cygwin at gmail dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Wed, 2 Feb 2011 08:25:48 +1030
- Subject: Re: LTO vs. default section alignment vs. relocatable links.
- References: <4D487ED3.6010304@gmail.com>
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..
--
Alan Modra
Australia Development Lab, IBM