This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Update LTO plugin interface
On Wed, Dec 1, 2010 at 12:55 PM, Ian Lance Taylor <iant@google.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> On Wed, Dec 1, 2010 at 12:37 PM, Ian Lance Taylor <iant@google.com> wrote:
>>
>>> Are you planning to have the plugin claim all files, even linker
>>> scripts, and then pass only the command line files back to the linker?
>>>
>>
>> Plugin will keep the same claim strategy. ?For those aren't claimed by
>> plugin, plugin will save and pass them back to linker only if they are
>> specified at command line.
>
> Just to be clear, that does not make sense as written. ?If the plugin
> does not claim a file, it should not then pass it back to the linker.
API has
typedef
enum ld_plugin_status
(*ld_plugin_claim_file_handler) (
const struct ld_plugin_input_file *file, int *claimed);
For linker script, archive, DSO and object file without IR,
*claimed will return 0 and plugin will save and pass it back to
linker later in if it is specified at command line.
> In fact, if the plugin claims all files, then as far as I can see your
> new ld_plugin_input_file field is not required. ?And if the plugin does
> not claim all files, I don't see how this can work.
Stage 2 linker should:
1. Discard all previous inputs.
2. Generate the final executable with inputs from plugin, which include
linker script, archive, DSO and object file without IR specified at
command line as well as trans files from LTO.
My implementation is available on hjl/lto branch at
http://git.kernel.org/?p=devel/binutils/hjl/x86.git;a=summary
http://git.kernel.org/?p=devel/gcc/hjl/x86.git;a=summary
--
H.J.