1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/lib/Object
Fangrui Song 2174d3b961 [LTO] Add SelectionKind to IRSymtab and use it in ld.lld/LLVMgold
In PGO, a C++ external linkage function `foo` has a private counter
`__profc_foo` and a private `__profd_foo` in a `comdat nodeduplicate`.

A `__attribute__((weak))` function `foo` has a weak hidden counter `__profc_foo`
and a private `__profd_foo` in a `comdat nodeduplicate`.

In `ld.lld a.o b.o`, say a.o defines an external linkage `foo` and b.o
defines a weak `foo`. Currently we treat `comdat nodeduplicate` as `comdat any`,
ld.lld will incorrectly consider `b.o:__profc_foo` non-prevailing.  In the worst
case when `b.o:__profd_foo` is retained and `b.o:__profc_foo` isn't, there will
be dangling reference causing an `undefined hidden symbol` error.

Add SelectionKind to `Comdat` in IRSymtab and let linkers ignore nodeduplicate comdat.

Differential Revision: https://reviews.llvm.org/D106228
2021-07-20 13:22:00 -07:00
..
Archive.cpp [NFC][libObject] clang-format Archive{.h,.cpp} 2021-05-27 16:48:40 -07:00
ArchiveWriter.cpp
Binary.cpp [SystemZ][z/OS] Add GOFF support to file magic identification 2021-07-20 10:50:47 -04:00
CMakeLists.txt
COFFImportFile.cpp
COFFModuleDefinition.cpp
COFFObjectFile.cpp [NFC][object] Change the input parameter of the method isDebugSection. 2021-05-26 08:47:53 +00:00
Decompressor.cpp
ELF.cpp
ELFObjectFile.cpp [AMDGPU] Add gfx1035 target 2021-06-24 14:32:41 -04:00
Error.cpp
FaultMapParser.cpp
IRObjectFile.cpp
IRSymtab.cpp [LTO] Add SelectionKind to IRSymtab and use it in ld.lld/LLVMgold 2021-07-20 13:22:00 -07:00
MachOObjectFile.cpp MachOObjectFile.cpp - remove unused <string> include. NFCI. 2021-06-13 15:19:24 +01:00
MachOUniversal.cpp
MachOUniversalWriter.cpp
Minidump.cpp
ModuleSymbolTable.cpp [MC] Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo 2021-05-23 14:15:23 -07:00
Object.cpp
ObjectFile.cpp [SystemZ][z/OS] Add GOFF support to file magic identification 2021-07-20 10:50:47 -04:00
RecordStreamer.cpp
RecordStreamer.h
RelocationResolver.cpp [ARM] Fix RELA relocations for 32bit ARM. 2021-07-14 14:27:15 -07:00
SymbolicFile.cpp [SystemZ][z/OS] Add GOFF support to file magic identification 2021-07-20 10:50:47 -04:00
SymbolSize.cpp [llvm-objdump][XCOFF] Enable the -l (--line-numbers) option. 2021-06-10 04:37:06 +00:00
TapiFile.cpp [TextAPI] add symbol name prefixes to central location, NFC 2021-06-23 11:21:00 -07:00
TapiUniversal.cpp
WasmObjectFile.cpp [WebAssembly] Support R_WASM_MEMORY_ADDR_TLS_SLEB64 for wasm64 2021-07-19 10:22:43 -07:00
WindowsMachineFlag.cpp
WindowsResource.cpp
XCOFFObjectFile.cpp [llvm-readobj][XCOFF] Add support for printing the String Table. 2021-07-05 04:16:58 +00:00