diff options
author | Martin Storsjö <martin@martin.st> | 2024-04-15 20:14:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-15 20:14:07 +0300 |
commit | 9c970d5ecd6a85188cd2b0a941fcd4d60063ef81 (patch) | |
tree | 5591dc6250352006738c725aebf6baae51c749e4 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | |
parent | bd7b170e97e314cb786dd33a750ef79412fc9682 (diff) | |
download | llvm-9c970d5ecd6a85188cd2b0a941fcd4d60063ef81.zip llvm-9c970d5ecd6a85188cd2b0a941fcd4d60063ef81.tar.gz llvm-9c970d5ecd6a85188cd2b0a941fcd4d60063ef81.tar.bz2 |
[LLD] [COFF] Don't add pseudo relocs for dangling references (#88487)
When doing GC, we normally won't have dangling references, because such
a reference would keep the other section alive, keeping it from being
eliminated.
However, references within DWARF sections are ignored for the purposes
of GC (because otherwise, they would essentially keep everything alive,
defeating the point of the GC), see
c579a5b1d92a9bc2046d00ee2d427832e0f5ddec for more context.
Therefore, dangling relocations against discarded symbols are ignored
within DWARF sections (see maybeReportRelocationToDiscarded in
Chunks.cpp). Consequently, we also shouldn't create any pseudo
relocations for these cases, as we run into a null pointer dereference
when trying to generate the pseudo relocation info for it.
This fixes the downstream bug
https://github.com/mstorsjo/llvm-mingw/issues/418, fixing crashes on
combinations with -ffunction-sections, -fdata-sections,
-Wl,--gc-sections and debug info.
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions