This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC -- add section alignment/size hooks to gold plugin interface

> I would like to enhance the gold linker to support plugins that want to ask
> for the size and alignment requirement of specific input sections.  A first
> draft of a patch that implements this is attached; I would welcome any
> questions + comments.
> The motivation for this work is enabling things such as static data layout,
> e.g. reordering of .bss/.data/.rodata sections to reduce padding and/or
> improve cache utilization. There is a paper that talks about this at
> This is my first attempt at contributing to gold, so any pointers on
> process, documentation, testing, etc would be appreciated.

Thanks! This looks good except for a few minor things:

- You generated the diff backwards, so it reads as a reversion of your patch.

- The new files you've added should list just 2016 as the copyright date.

- plugin-api.h is in a separate directory (include) with its own
ChangeLog, so the entry for that should be in include/ChangeLog, not

- ChangeLog and regenerated files like should be omitted
from the patch. It's customary to post the ChangeLog entries above the
patch (and include them in the commit message). If the patch is an
attachment, it's easier for the reviewer if you can also paste the
ChangeLog entries into the plain text of the message itself. Each
block of ChangeLog entries should be preceded by the directory where
the ChangeLog is located (e.g., "include/" or "include/ChangeLog";
"gold/" or "gold/ChangeLog").

- ChangeLog entries should read as complete sentences, starting with a
capital and ending with a period.

>        * plugin-api.h: add new hooks to the plugin transfer vector to
>          to support querying section alignment and section size

Please list each new hook separately, and separate the change to the
ld_plugin_tag enum:

        * plugin-api.h (ld_plugin_get_input_section_alignment): New hook.
        (ld_plugin_get_input_section_size): New hook.
        (ld_plugin_tag): Add LDPT_GET_INPUT_SECTION_ALIGNMENT

>        * (Plugin::load): include hooks for get_input_section_size
>          and get_input_section_alignment to transfer vector

Please add entries for get_input_section_alignment and
get_input_section_size (each described as "New function").

>        * testsuite/ Add test

Rewrite this as

        * testsuite/ (plugin_layout_with_alignment): New test.

Also, please update the GCC wiki page with your new interfaces:

Since this affects the plugin API used by GCC, you should also include
gcc-patches in the discussion. When this is ready to checkin, you'll
also need to update include/plugin-api.h in the GCC tree as well to
keep them in sync.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]