[Proposed patch] Huge performance regression in ld -r since binutils >= 2.21

Alan Modra amodra@gmail.com
Mon Nov 9 10:41:00 GMT 2015


On Mon, Nov 09, 2015 at 10:04:42AM +0100, Romain Geissler wrote:
> What's the problem with partial linking ?

Section coalescing.  What is joined together is not easily separated.

- Architectures with limited branch offsets may find text sections
  become so large that a branch can't reach to a section boundary,
  which is where trampolines are usually placed.

- Architectures with limited data addressing may find that tables of
  constants and/or addresses are too large, and schemes that cope with
  this by making multiple tables, fail when one section is too large
  all by itself.

- Sections are combined in ways that lose code locality.  eg. with
  -ffunction-sections, all C static functions called "setup" will be
  placed together.

- -gc-sections works on a section basis.  Finer granularity allows
  more junk to be discarded.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list