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

Mekhanoshin, Stanislav Stanislav.Mekhanoshin at amd.com
Fri Apr 25 11:31:14 PDT 2014

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.


-----Original Message-----
From: Rafael EspĂ­ndola [mailto:rafael.espindola at gmail.com] 
Sent: Friday, April 25, 2014 10:24 PM
To: Mekhanoshin, Stanislav
Cc: reviews+D3459+public+156625a4405c5834 at reviews.llvm.org; Arsenault, Matthew; llvm-commits
Subject: Re: [PATCH] Add -l option to llvm-link and allow linking by resolving symbols

On 25 April 2014 14:21, Mekhanoshin, Stanislav <Stanislav.Mekhanoshin at amd.com> wrote:
> This is in fact an extraction from such a tool into a more general interface. If no one else needs this I do not insist anyway.
> BTW, I do remember that Borland linker a while ago was doing such a thing. This is purely an optimization and in our case this allows to speed up compilation by dropping unneeded stuff before IPO.

It is not just an optimization. Fetching a function f can produce an undefined reference to g which can cause an static initializer to be fetched. That static initializer will still run even if f is then dropped by a gc pass.


More information about the llvm-commits mailing list