RFC -- add section alignment/size hooks to gold plugin interface
Cary Coutant
ccoutant@gmail.com
Mon Feb 22 02:30:00 GMT 2016
More information about the Binutils mailing list
Mon Feb 22 02:30:00 GMT 2016
- Previous message (by thread): [PATCH] Set BFD compression bits in write_object_file
- Next message (by thread): [Ping] Re: [AArch64] Remove redundant calculation of plt stub destination for veneer
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> 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 > https://dl.acm.org/citation.cfm?id=1152181. > > 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 gold/ChangeLog. - ChangeLog and regenerated files like Makefile.in 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: include/ * 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 and LDPT_GET_INPUT_SECTION_SIZE. > * plugin.cc (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/Makefile.am: Add plugin_layout_with_alignment.sh test Rewrite this as gold/ * testsuite/Makefile.am (plugin_layout_with_alignment): New test. Also, please update the GCC wiki page with your new interfaces: https://gcc.gnu.org/wiki/whopr/driver 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. -cary
- Previous message (by thread): [PATCH] Set BFD compression bits in write_object_file
- Next message (by thread): [Ping] Re: [AArch64] Remove redundant calculation of plt stub destination for veneer
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list