From: Fangrui Song Date: Wed, 3 Nov 2021 07:56:09 +0000 (-0700) Subject: Revert "[ELF] Try appeasing --target=armv7-linux-androideabi24 sanitizer symbolizatio... X-Git-Tag: upstream/15.0.7~26862 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c977564fc2bad94022b3931365c549c8477831d9;p=platform%2Fupstream%2Fllvm.git Revert "[ELF] Try appeasing --target=armv7-linux-androideabi24 sanitizer symbolization tests" This reverts commit 5cbec88cbf1c8d06030b84ebf17f5eebc3e3f1f9. Vitaly said that 2faac77f26dee2a1367f373180573ea9c56efed1 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. --- diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 819ca7a..ff16922 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -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; diff --git a/llvm/include/llvm/Object/ELFObjectFile.h b/llvm/include/llvm/Object/ELFObjectFile.h index 8b45342..716b94d 100644 --- a/llvm/include/llvm/Object/ELFObjectFile.h +++ b/llvm/include/llvm/Object/ELFObjectFile.h @@ -733,7 +733,8 @@ Expected ELFObjectFile::getSymbolFlags(DataRefImpl Sym) const { } else if (EF.getHeader().e_machine == ELF::EM_ARM) { if (Expected 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 {