llvm-capstone/lld/COFF
Reid Kleckner 7ce9a3e9a9 [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
2021-03-22 15:36:26 -07:00
..
CallGraphSort.cpp [COFF] Port CallGraphSort to COFF from ELF 2020-07-30 15:21:44 -07:00
CallGraphSort.h [COFF] Port CallGraphSort to COFF from ELF 2020-07-30 15:21:44 -07:00
Chunks.cpp Re-land "[PDB] Defer relocating .debug$S until commit time and parallelize it" 2021-03-10 15:14:09 -08:00
Chunks.h [COFF] Only consider associated EH sections during ICF 2021-03-22 15:36:26 -07:00
CMakeLists.txt [COFF] Port CallGraphSort to COFF from ELF 2020-07-30 15:21:44 -07:00
Config.h [lld-link] Add safe icf mode to lld-link, which does safe icf for all sections. 2021-03-03 14:52:33 -08:00
DebugTypes.cpp [LLD][COFF] Avoid std::vector resizes during type merging 2021-01-13 14:35:03 -05:00
DebugTypes.h [LLD][COFF] Simplify function. NFC. 2021-01-07 22:37:11 -05:00
DLL.cpp [CFGuard] Add address-taken IAT tables and delay-load support 2020-11-17 18:24:45 -08:00
DLL.h
Driver.cpp [lld-link] Add safe icf mode to lld-link, which does safe icf for all sections. 2021-03-03 14:52:33 -08:00
Driver.h [lld-link] Add /reproduce: support for several flags 2021-02-22 16:52:49 -05:00
DriverUtils.cpp Avoid a possible one-byte OOB read off of .drectve sections 2020-12-09 13:32:28 -08:00
ICF.cpp [COFF] Only consider associated EH sections during ICF 2021-03-22 15:36:26 -07:00
ICF.h [lld-link] Add safe icf mode to lld-link, which does safe icf for all sections. 2021-03-03 14:52:33 -08:00
InputFiles.cpp [CFGuard] Add address-taken IAT tables and delay-load support 2020-11-17 18:24:45 -08:00
InputFiles.h [gn build] (manually) port b534beabee 2020-11-25 20:19:46 -05:00
LLDMapFile.cpp
LLDMapFile.h
LTO.cpp [lld][COFF] Add command line options for LTO with new pass manager 2020-11-05 14:41:35 -05:00
LTO.h
MapFile.cpp
MapFile.h
MarkLive.cpp
MarkLive.h
MinGW.cpp [LLD] [COFF] Allow wrapping dllimported functions 2020-11-24 10:15:20 +02:00
MinGW.h Reapply [LLD] [COFF] Implement a GNU/ELF like -wrap option 2020-10-15 22:14:02 +03:00
Options.td [lld] Consistent help text for --save-temps 2021-01-25 10:27:18 -08:00
PDB.cpp [PDB] Improve warning for corrupt debug info 2021-03-11 14:28:09 -08:00
PDB.h Re-land "[PDB] Merge types in parallel when using ghashing" 2020-09-30 15:44:38 -07:00
README.md
Symbols.cpp
Symbols.h [CFGuard] Add address-taken IAT tables and delay-load support 2020-11-17 18:24:45 -08:00
SymbolTable.cpp Reapply [LLD] [COFF] Implement a GNU/ELF like -wrap option 2020-10-15 22:14:02 +03:00
SymbolTable.h [COFF] Assign unique identifiers to ObjFiles from LTO 2020-04-17 17:15:12 -07:00
TypeMerger.h [PDB] Use one func id DenseMap instead of per-source maps, NFC 2020-10-01 12:22:27 -07:00
Writer.cpp [CFGuard] Add address-taken IAT tables and delay-load support 2020-11-17 18:24:45 -08:00
Writer.h [LLD][COFF] Cover usage of LLD-as-a-library in tests 2020-09-24 15:07:50 -04:00

See docs/NewLLD.rst