Link with mixed IR/non-IR objects
H.J. Lu
hjl.tools@gmail.com
Thu Apr 28 02:06:00 GMT 2011
On Wed, Apr 27, 2011 at 5:23 PM, Alan Modra <amodra@gmail.com> wrote:
> On Wed, Apr 27, 2011 at 07:38:23AM -0700, H.J. Lu wrote:
>> They are different. SHT_GNU_OBJECT_ONLY section doesn't contain
>> any IR. It encapsulates a relocatable object file without any IR bits.
>
> I think we first should ask whether GNU ld needs to support ld -r
> with mixed IR and normal object files. I'm inclined to think that ld
> should not do the segregation of object files and effectively perform
> two linking operations with one output file stored inside the other.
> Why can't we simply issue an error if someone tries to mix object
> files like this?
>
This is for usability. Many projects use "ld -r" on object files
generated from C/C++ sources, assembly codes as well as
from the third party vendors. If "ld -r" doesn't work on mixed IR
and non-IR object files, they have to change the build infrastructure
if they want to use LTO.
--
H.J.
More information about the Binutils
mailing list