This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Linker plugin API.
- From: Oleg Ogurtsov <o dot ogurtsov at samsung dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Mon, 21 May 2018 11:40:06 +0300
- Subject: Re: Linker plugin API.
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180521084012euoutp014c782eb0c54692e5278dc08c3355514f~wnDIDD_Ng2960429604euoutp01b
- References: <CGME20180420121355eucas1p1cc7fc0d940d689707079571ec3c5e54a@eucas1p1.samsung.com> <2b7ed02f-a914-30cc-9b56-e746fa2634d2@samsung.com> <CAJimCsEaWZ5MoJQVuNOF=_GV56mGgCqWLYqj+RYf5NgzROO6vw@mail.gmail.com>
I maked the new output statement and bfd section in ldlang.c inside
lang_place_orphans().
The section is created with flags (ALLOC, LOAD, !RELOC, READ ONLY,
HAS_CONTENTS, !NEVER_LOAD, !IS_COMMON, !MERGE, !SEC_GROUP,
!LINKER_HAS_INPUT), but has wrong VMA and offset in output file.
What am I missing?
On 04/23/2018 07:13 PM, Cary Coutant wrote:
>> 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
> Best regards,
Oleg Ogurtsov.