[llvm-commits] Atom alignment
Nick Kledzik
kledzik at apple.com
Mon Oct 15 12:21:14 PDT 2012
On Oct 15, 2012, at 11:54 AM, Shankar Kalpathi Easwaran wrote:
> Hi,
>
> I think we will also get gaps in the output if the atoms are processed in a out of order fashion.
>
> Example:
>
> Say there are two files that are part of the linking process 1.o, 2.o
>
> 1.o has data symbols (a, b)
> 2.o has data symbols (c, d)
>
> a, b has alignment requirements of 4 whereas c, d has alignment requirements of 16
>
> So when we try to write the output with the following use cases :
>
> 1) the atoms appear as a,b,c,d the output file appears properly
> 2) the atoms appear as a,c,b,d the output file will have gaps
> 3) whenever there is an atom movement because of symbol resolution, the output file will have gaps too
>
> How do we go about without having gaps in the output file consistently and the output file using optimum space ?
My philosophy is that the default layout should be super simple and predictable (e.g. file order, then order within file, so: a, b, c, d which means gaps).
But we can write an optional optimization Pass which re-orders the data for better packing. On embedded systems packing might be normal mode.
On darwin, we have tools to produce "order files" which determine working sets of symbols by monitoring use at runtime. By packing data symbols based on usage, you get fewer dirty pages at runtime.
-Nick
>
> Should the sections and the atom offsets be fixed after running it through the Reader.
>
> Thanks
>
> Shankar Easwaran
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
>
>
>
> -----Original Message-----
> From: Sid Manning [mailto:sidneym at codeaurora.org]
> Sent: Monday, October 15, 2012 11:23 AM
> To: LLVM Commits; Hemant Kulkarni; Michael Spencer; Nick Kledzik; Evandro; Easwaran, Shankar
> Subject: Atom alignment
>
>
> DefinedAtom's alignment method is applying section alignment constraints to every atom in the chunk and this causes gaps in the output. This change returns alignment only if the atom is a section symbol.
>
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121015/cfb65809/attachment.html>
More information about the llvm-commits
mailing list