[PATCH] Add -l option to llvm-link and allow linking by resolving symbols

Mekhanoshin, Stanislav Stanislav.Mekhanoshin at amd.com
Fri Apr 25 12:20:31 PDT 2014


I think I know the difference. In both cases the issue was documented. That is like with ANSI aliasing rules – you can technically break it, but advised not to do so in return of some benefits. Otherwise you can advise compiler not to do any assumptions about the aliasing. Here in this case default is safe and an optional way of doing the linking can give some benefits in return to some reasonable discipline. It may need a better documentation though.

Stas

From: Reid Kleckner [mailto:rnk at google.com]
Sent: Friday, April 25, 2014 10:48 PM
To: Mekhanoshin, Stanislav
Cc: Rafael Espíndola; llvm-commits; reviews+D3459+public+156625a4405c5834 at reviews.llvm.org
Subject: Re: [PATCH] Add -l option to llvm-link and allow linking by resolving symbols

On Fri, Apr 25, 2014 at 11:31 AM, Mekhanoshin, Stanislav <Stanislav.Mekhanoshin at amd.com<mailto:Stanislav.Mekhanoshin at amd.com>> wrote:
That is correct. The assumption is that such static initializers of unreferenced symbols do not have side effects. If I remember correctly Borland smart linker had the same limitation. Also, if I remember correctly LTO with Sun Solaris was also limited by this.

I wish this was a reasonable assumption. However, we live in a dark world of great evil, where programs spawn threads from their dynamic initializers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140425/eefe5929/attachment.html>


More information about the llvm-commits mailing list