mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
Fix another --gc-sections crash.
The missing case was when a merge section was only referenced from non-alloca sections. llvm-svn: 282847
This commit is contained in:
@@ -620,6 +620,9 @@ typename ELFT::uint MergeInputSection<ELFT>::getOffset(uintX_t Offset) const {
|
||||
if (It != OffsetMap.end())
|
||||
return It->second;
|
||||
|
||||
if (!this->Live)
|
||||
return 0;
|
||||
|
||||
// If Offset is not at beginning of a section piece, it is not in the map.
|
||||
// In that case we need to search from the original section piece vector.
|
||||
const SectionPiece &Piece = *this->getSectionPiece(Offset);
|
||||
|
||||
@@ -17,5 +17,11 @@ _start:
|
||||
.Lbar:
|
||||
.long 2
|
||||
|
||||
.section .merge2,"aM",@progbits,4
|
||||
.p2align 2
|
||||
.Lzed:
|
||||
.long 1
|
||||
|
||||
.section bar
|
||||
.quad .Lbar
|
||||
.quad .Lzed
|
||||
|
||||
Reference in New Issue
Block a user