diff options
author | Pengying Xu <xpy66swsry@gmail.com> | 2025-08-08 11:25:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-07 20:25:36 -0700 |
commit | ffdaf85a95026945c654f981b09267ce9f81ae80 (patch) | |
tree | 47e7d26c38e7fc73aa22fa950f0d5e1eb9f84102 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | b9ca01b7464caa211841f88281d0a7ed0a97d634 (diff) | |
download | llvm-ffdaf85a95026945c654f981b09267ce9f81ae80.zip llvm-ffdaf85a95026945c654f981b09267ce9f81ae80.tar.gz llvm-ffdaf85a95026945c654f981b09267ce9f81ae80.tar.bz2 |
[lld][ELF] filter out section symbols when use BP reorder (#151685)
When using Temporal Profiling with the BP algorithm, we encounter an
issue with the internal function reorder. In cases where the symbol
table contains entries like:
```
Symbol table '.symtab' contains 45 entries:
Num: Value Size Type Bind Vis Ndx Name
10: 0000000000000000 0 SECTION LOCAL DEFAULT 18 .text.L1
11: 0000000000000000 24 FUNC LOCAL DEFAULT 18 L1
````
The zero-sized section symbol .text.L1 gets stored in the secToSym map
first. However, when the function lookup searches for L1 (as seen in
[BPSectionOrdererBase.inc:191](https://github.com/llvm/llvm-project/blob/main/lld/include/lld/Common/BPSectionOrdererBase.inc#L191)),
it fails to find the correct entry in rootSymbolToSectionIdxs because
the section symbol has already claimed that slot.
This patch fixes the issue by skipping zero-sized symbols during the
addSections process, ensuring that function symbols are properly
registered for lookup.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions