diff options
author | Fangrui Song <i@maskray.me> | 2020-11-26 09:13:08 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2020-11-26 09:13:09 -0800 |
commit | 668da8c361fef5ada092534d4d20ea450831f6f6 (patch) | |
tree | fdf7c4522c0eac8ada701ff9aecdf8ca88085548 /llvm/lib/MC/MCObjectFileInfo.cpp | |
parent | 6d648e69c0949e8942cab88e7ec13f5037364338 (diff) | |
download | llvm-668da8c361fef5ada092534d4d20ea450831f6f6.zip llvm-668da8c361fef5ada092534d4d20ea450831f6f6.tar.gz llvm-668da8c361fef5ada092534d4d20ea450831f6f6.tar.bz2 |
[MC] Set the unique id of .stack_sizes to the associated .text section's
Similar to D92113. Currently `clang -fstack-size-section -fno-unique-section-names`
sets the linked-to symbol to the first `.text`, which is:
* incorrect for COMDAT sections
* inferior for non-COMDAT sections in -ffunction-sections mode (poor --gc-sections: .stack_sizes cannot be separately discarded)
Note, if the section symbol can be referenced in more places (if the
function begin symbol does not apply), we probably should consider
defining a different BeginSymbol for sections with ",unique" linkage.
Reviewed By: grimar, jhenderson
Differential Revision: https://reviews.llvm.org/D92151
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r-- | llvm/lib/MC/MCObjectFileInfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index b8c66c6..75e65e3 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -997,7 +997,7 @@ MCObjectFileInfo::getStackSizesSection(const MCSection &TextSec) const { } return Ctx->getELFSection(".stack_sizes", ELF::SHT_PROGBITS, Flags, 0, - GroupName, MCSection::NonUniqueID, + GroupName, ElfSec.getUniqueID(), cast<MCSymbolELF>(TextSec.getBeginSymbol())); } |