Shankar Easwaran
2013-Aug-27 05:20 UTC
[LLVMdev] [lld] adding deadStrip() to undefined Atoms
Hi, Can we add deadStrip() to undefinedAtoms as well ? This will enable to choose whether we want to set the property deadStripNormal or deadStripNever on them. Also I think it will be cleaner for atoms to be added to deadStripRoot set using a single API. Thanks Shankar Easwaran -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation
I think that's a good idea. One thing we should be careful is not to unconditionally propagate dead strip attribute from undefined atom to defined one, but choose the most restrictive one (deadStripNever takes precedence over deadStripNormal) when replacing an undefined atom with an defined one. On Mon, Aug 26, 2013 at 10:20 PM, Shankar Easwaran <shankare at codeaurora.org>wrote:> Hi, > > Can we add deadStrip() to undefinedAtoms as well ? > > This will enable to choose whether we want to set the property > deadStripNormal or deadStripNever on them. > > Also I think it will be cleaner for atoms to be added to deadStripRoot set > using a single API. > > Thanks > > Shankar Easwaran > > -- > 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<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130826/09e8e3ab/attachment.html>
On Aug 26, 2013, at 10:20 PM, Shankar Easwaran wrote:> Can we add deadStrip() to undefinedAtoms as well ? > > This will enable to choose whether we want to set the property deadStripNormal or deadStripNever on them. > > Also I think it will be cleaner for atoms to be added to deadStripRoot set using a single API.Can you give more more background on this? When would you want and undef that causes the whatever defined atom replaces it to be never dead stripped? For darwin's current linker (ld64), the driver adds an initial undefs to the dead strip root set. -Nick
Shankar Easwaran
2013-Aug-27 18:35 UTC
[LLVMdev] [lld] adding deadStrip() to undefined Atoms
Hi Nick, On 8/27/2013 12:45 AM, Nick Kledzik wrote:> On Aug 26, 2013, at 10:20 PM, Shankar Easwaran wrote: >> Can we add deadStrip() to undefinedAtoms as well ? >> >> This will enable to choose whether we want to set the property deadStripNormal or deadStripNever on them. >> >> Also I think it will be cleaner for atoms to be added to deadStripRoot set using a single API. > Can you give more more background on this? When would you want and undef that causes the whatever defined atom replaces it to be never dead stripped?We have these options a) -entry <symbolname> b) -init <symbolname> c) -fini <symbolname> The atoms created for this shouldnot be dead stripped, as there is an explicit reference from the command line. The other options such as a) --defsym newsymbol = oldsymbol + 100 b) --wrap newsymbol have the other effect that if there is no reference to the symbols /newsymbol, and __wrap_newsymbol, /the atoms are removed. Also rather than having the symbols seperately considered in the Driver, on whether we want to add to the deadStripRoot set or not, we can just use the attributes on the atom to place them in the deadStripRoot set / not. On the similiar lines, I think it should become an atom property itself (having absoluteAtoms also have this property set) ? What do you think ? Thanks Shankar Easwaran -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130827/1ce82f84/attachment.html>