Linker plugin API.

Cary Coutant ccoutant@gmail.com
Mon Apr 23 16:13:00 GMT 2018


> Is it possible to add/change/delete ELF Note sections from the linker
> plugin?
> I have object files with PT_NOTE sections and  non-standard fields. The
> linker add fields from all object files to the output file.
> I want to process fields and get one result field for output file. Is it
> possible from plugin?
> Where it is better to make such processing?
> I would be grateful for the help.

The plugin API currently doesn't have any way to do something like
this. It's theoretically possible, but it would take some pretty deep
hooks in the linker to add plugin support for section merging and
rewriting like this.

If you need it done at link time, I would suggest using a new
vendor-specific section type instead of SHT_NOTE, and you can add
built-in support to the linker for that section type. I'd prefer to
discourage the overuse of SHT_NOTE sections for information that is
more than mere notes.

-cary



More information about the Binutils mailing list