Support dead-stripping in ELF objects

Jim Grosbach grosbach at apple.com
Tue Apr 2 15:13:12 PDT 2013


Hi Paul,

Seems generally reasonable to me. MachO uses that directive to twiddle a bit in the .o file to let the linker know the rest of the file has been laid out in such a way that it can play tricks like dead stripping and otherwise moving atoms around relative to one another. In addition to changing how the relocs are handled, I'd suggest adding something like that for ELF so a linker can know at a glance which files it can play games with.

My only real concern is that without a consumer for the information, bitrot can easily set in. Do you know if there's work coming (maybe in lld?) that would take advantage of this information?

-Jim


On Mar 26, 2013, at 9:45 AM, "Robinson, Paul" <Paul.Robinson at am.sony.com> wrote:

> Ping...
> 
>> -----Original Message-----
>> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
>> bounces at cs.uiuc.edu] On Behalf Of Robinson, Paul
>> Sent: Thursday, March 21, 2013 11:30 AM
>> To: llvm-commits at cs.uiuc.edu commits (llvm-commits at cs.uiuc.edu)
>> Subject: RE: Support dead-stripping in ELF objects
>> 
>> This time with the attachment...
>> --paulr
>> 
>>> -----Original Message-----
>>> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
>>> bounces at cs.uiuc.edu] On Behalf Of Robinson, Paul
>>> Sent: Thursday, March 21, 2013 11:14 AM
>>> To: llvm-commits at cs.uiuc.edu commits (llvm-commits at cs.uiuc.edu)
>>> Subject: Support dead-stripping in ELF objects
>>> 
>>> A while back I implemented some private changes to how relocations
>>> were handled in the ELF object writer, so that our linker could
>>> support dead-stripping.  Apparently MachO has a similar feature, so I
>>> leveraged some of what was done for that target, including reusing the
>>> assembler flag/directive.
>>> 
>>> I'm told that there may be broader interest in supporting
>>> dead-stripping in ELF objects, so here's the patch.
>>> 
>>> There is currently no in-tree ELF-using target that invokes this
>>> stuff; I'm putting it out there so anyone who's interested can take
>>> advantage of it in their own target/toolchain.
>>> 
>>> Please review, and commit for me if it's okay.
>>> 
>>> Thanks,
>>> --paulr
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> <Deadstrip-diff.txt>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list