Revert "[ELF] Try appeasing --target=armv7-linux-androideabi24 sanitizer symbolization tests"

This reverts commit 5cbec88cbf.

Vitaly said that 2faac77f26 actually works.

Sanitizer's armv7-linux-androideabi24 configuration has other issues which haven't been identified yet, but that's unrelated to the empty symbol name issue.
This commit is contained in:
Fangrui Song 2021-11-03 00:56:09 -07:00
parent 24f80d94b4
commit c977564fc2
2 changed files with 3 additions and 2 deletions

View File

@ -726,7 +726,7 @@ static bool shouldKeepInSymtab(const Defined &sym) {
// * --discard-locals is used.
// * The symbol is in a SHF_MERGE section, which is normally the reason for
// the assembler keeping the .L symbol.
if ((sym.getName().empty() || sym.getName().startswith(".L")) &&
if (sym.getName().startswith(".L") &&
(config->discard == DiscardPolicy::Locals ||
(sym.section && (sym.section->flags & SHF_MERGE))))
return false;

View File

@ -733,7 +733,8 @@ Expected<uint32_t> ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Sym) const {
} else if (EF.getHeader().e_machine == ELF::EM_ARM) {
if (Expected<StringRef> NameOrErr = getSymbolName(Sym)) {
StringRef Name = *NameOrErr;
if (Name.startswith("$d") || Name.startswith("$t") ||
// TODO Investigate why empty name symbols need to be marked.
if (Name.empty() || Name.startswith("$d") || Name.startswith("$t") ||
Name.startswith("$a"))
Result |= SymbolRef::SF_FormatSpecific;
} else {