[gold] LLVM plugin and PIE

Remi Gacogne rgacogne-bugs@coredump.fr
Tue Jun 12 15:40:00 GMT 2012


Hi,

I am trying to fix an issue in LLVM preventing the use of LTO when 
building a PIE.

The issue is caused by the fact that the LLVM Gold plugin incorrectly 
generates a non-PIC/ non-PIE object when LDPT_LINKER_OUTPUT is set to 
LDPO_EXEC, even if a PIE build is needed. I know this is a LLVM issue and 
not a Gold one, but I am looking for a way for the plugin to know that a 
PIE build has been required.

GCC solves this by passing various options through the COLLECT_GCC_OPTIONS 
env variable, and I was wondering if it was possible to avoid doing 
something of the same kind using informations that Gold already provides 
to the plugin? I haven't been able to find such information in the WHOPR 
design, but I may have missed something.


Thanks,


-- 
Regards,

Remi



More information about the Binutils mailing list