[llvm] 2faac77 - [ARM] Make empty name symbols SF_FormatSpecific to try appeasing --target=armv7-linux-androideabi24 sanitizer symbolization tests

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 2 17:10:48 PDT 2021


Author: Fangrui Song
Date: 2021-11-02T17:10:42-07:00
New Revision: 2faac77f26dee2a1367f373180573ea9c56efed1

URL: https://github.com/llvm/llvm-project/commit/2faac77f26dee2a1367f373180573ea9c56efed1
DIFF: https://github.com/llvm/llvm-project/commit/2faac77f26dee2a1367f373180573ea9c56efed1.diff

LOG: [ARM] Make empty name symbols SF_FormatSpecific to try appeasing --target=armv7-linux-androideabi24 sanitizer symbolization tests

This is similar to D98669 but I don't know whether and why ARM needs it.

I suspect this may fix the sanitizer-x86_64-linux-android bot which runs
--target=armv7-linux-androideabi24 tests
(https://lab.llvm.org/buildbot/#/builders/77)

Someone needs to investigate the root cause and I am not sure this hack
fixes the bot.

Added: 
    

Modified: 
    llvm/include/llvm/Object/ELFObjectFile.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Object/ELFObjectFile.h b/llvm/include/llvm/Object/ELFObjectFile.h
index 8b45342b4530a..716b94d92d032 100644
--- a/llvm/include/llvm/Object/ELFObjectFile.h
+++ b/llvm/include/llvm/Object/ELFObjectFile.h
@@ -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 {


        


More information about the llvm-commits mailing list