Skip to content

Commit 5cbec88

Browse files
committed
[ELF] Try appeasing --target=armv7-linux-androideabi24 sanitizer symbolization tests
1 parent 34f4fe3 commit 5cbec88

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lld/ELF/Writer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ static bool shouldKeepInSymtab(const Defined &sym) {
726726
// * --discard-locals is used.
727727
// * The symbol is in a SHF_MERGE section, which is normally the reason for
728728
// the assembler keeping the .L symbol.
729-
if (sym.getName().startswith(".L") &&
729+
if ((sym.getName().empty() || sym.getName().startswith(".L")) &&
730730
(config->discard == DiscardPolicy::Locals ||
731731
(sym.section && (sym.section->flags & SHF_MERGE))))
732732
return false;

llvm/include/llvm/Object/ELFObjectFile.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,8 +733,7 @@ Expected<uint32_t> ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Sym) const {
733733
} else if (EF.getHeader().e_machine == ELF::EM_ARM) {
734734
if (Expected<StringRef> NameOrErr = getSymbolName(Sym)) {
735735
StringRef Name = *NameOrErr;
736-
// TODO Investigate why empty name symbols need to be marked.
737-
if (Name.empty() || Name.startswith("$d") || Name.startswith("$t") ||
736+
if (Name.startswith("$d") || Name.startswith("$t") ||
738737
Name.startswith("$a"))
739738
Result |= SymbolRef::SF_FormatSpecific;
740739
} else {

0 commit comments

Comments
 (0)