[all-commits] [llvm/llvm-project] 7ce9a3: [COFF] Only consider associated EH sections during...

Reid Kleckner via All-commits all-commits at lists.llvm.org
Mon Mar 22 15:36:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7ce9a3e9a91bb0c71cd3560079ff4c31d5dade1b
      https://github.com/llvm/llvm-project/commit/7ce9a3e9a91bb0c71cd3560079ff4c31d5dade1b
  Author: Reid Kleckner <rnk at google.com>
  Date:   2021-03-22 (Mon, 22 Mar 2021)

  Changed paths:
    M lld/COFF/Chunks.h
    M lld/COFF/ICF.cpp
    A lld/test/COFF/icf-assoc-order.s
    A lld/test/COFF/icf-xdata-last.s

  Log Message:
  -----------
  [COFF] Only consider associated EH sections during ICF

The only known reason why ICF should not merge otherwise identical
sections with differing associated sections has to do with exception
handling tables. It's not clear what ICF should do when there are other
kinds of associated sections. In every other case when this has come up,
debug info and CF guard metadata, we have opted to make ICF ignore the
associated sections.

For comparison, ELF doesn't do anything for comdat groups. Instead,
.eh_frame is parsed to figure out if a section has an LSDA, and if so,
ICF is disabled.

Another issue is that the order of associated sections is not defined.
We have had issues in the past (crbug.com/1144476) where changing the
order of the .xdata/.pdata sections in the object file lead to large ICF
slowdowns.

To address these issues, I decided it would be best to explicitly
consider only .pdata and .xdata sections during ICF. This makes it easy
to ignore the object file order, and I think it makes the intention of
the code clearer.

I've also made the children() accessor return an empty list for
associated sections. This mostly only affects ICF and GC. This was the
behavior before I made this a linked list, so the behavior change should
be good. This had positive effects on chrome.dll: more .xdata sections
were merged that previously could not be merged because they were
associated with distinct .pdata sections.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D98993




More information about the All-commits mailing list