[PATCH] D139862: [llvm][Object] set SF_Hidden flag for MachO files

Cyndy Ishida via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 10:54:10 PST 2022


cishida created this revision.
cishida added reviewers: pete, ributzka, steven_wu.
Herald added a subscriber: hiraditya.
Herald added a project: All.
cishida requested review of this revision.
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139862

Files:
  llvm/lib/Object/MachOObjectFile.cpp


Index: llvm/lib/Object/MachOObjectFile.cpp
===================================================================
--- llvm/lib/Object/MachOObjectFile.cpp
+++ llvm/lib/Object/MachOObjectFile.cpp
@@ -1876,9 +1876,13 @@
         Result |= SymbolRef::SF_Undefined;
     }
 
-    if (!(MachOType & MachO::N_PEXT))
+    if (MachOType & MachO::N_PEXT)
+      Result |= SymbolRef::SF_Hidden;
+    else
       Result |= SymbolRef::SF_Exported;
-  }
+
+  } else if (MachOType & MachO::N_PEXT)
+    Result |= SymbolRef::SF_Hidden;
 
   if (MachOFlags & (MachO::N_WEAK_REF | MachO::N_WEAK_DEF))
     Result |= SymbolRef::SF_Weak;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139862.482191.patch
Type: text/x-patch
Size: 615 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221212/edf6547b/attachment.bin>


More information about the llvm-commits mailing list