[LLVMdev] LLD improvement plan

Eric Christopher echristo at gmail.com
Thu May 7 09:58:19 PDT 2015


On Thu, May 7, 2015 at 9:36 AM Shankar Easwaran <shankare at codeaurora.org>
wrote:

> On 5/7/2015 11:19 AM, Reid Kleckner wrote:
> > On Thu, May 7, 2015 at 8:36 AM, Shankar Easwaran <
> shankare at codeaurora.org>
> > wrote:
> >
> >> The atom model is optimized when you compile the code with
> >> -ffunction-sections and -fdata-sections.
> >>
> > Not really, -ffunction-sections -fdata-sections gives a section-based
> > linker the same flexibility as an atom-based linker.
> >
> > In the atom model, these extra sections simply serve as a crutch to
> ensure
> > that object files can be safely atomized. If you commit to the atom
> model,
> > you shouldn't even need these sections, you should only need a flag that
> > says "this section is safe for atomization". On MachO, this is what
> > .subsections_via_symbols is for.
> We could have this flag on ELF too ? This will reducing code from third
> party libraries ??
>

It's really not that much unless you're up against a very hard object file
input size to your linker. The total size added by -ffunction-sections is
very small.



> >
> >> Once targets start having -fno-unique-section-names as the default the
> >> atom model looks more promising.
> >>
> > Why does LLD care about -fno-unique-section-names? I thought this was
> just
> > an object file size optimization.
> Sorry I meant -ffunction-sections along with -fno-unique-section-names.
> >
>

There's not much a reason to do this now that we have the size optimization
that Rafael put in.

-eric


> >> Everyone likes to have the image size small, and making
> >> -ffunction-sections/-fdata-sections (or) -fno-unique-section-names the
> >> default make sense and the atom model design directly has a relation to
> it.
> >> In fact it simplifies the linker to not have extra data structures IMO.
> >
> > Again, the same is achievable in the section model by turning on these
> > flags and enabling --gc-sections or equivalent functionality.
> >
> > The only advantage I see to using the atom model for ELF and COFF is that
> > we could dead strip object files built without -ffunction-sections
> > -fdata-sections, which would allow us to turn these flags off in the
> > compiler and save on object file size. I suspect the complexity of the
> atom
> > model isn't worth the file size savings it offers.
> >
>
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
> by the Linux Foundation
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150507/0e04cb63/attachment.html>


More information about the llvm-dev mailing list