Loading...
mach_o/Symbol.cpp dyld-1340 dyld-1162
--- dyld/dyld-1340/mach_o/Symbol.cpp
+++ dyld/dyld-1162/mach_o/Symbol.cpp
@@ -38,7 +38,7 @@
 //
 // MARK: --- Symbol methods ---
 //
-Symbol Symbol::makeRegularExport(CString name, uint64_t imageOffset, uint8_t sectNum, bool dontDeadStrip, bool cold, bool neverStrip, bool isThumb)
+Symbol Symbol::makeRegularExport(CString name, uint64_t imageOffset, uint8_t sectNum, bool dontDeadStrip, bool cold, bool neverStrip)
 {
     Symbol symbol(name);
     symbol._kind        = Kind::regular;
@@ -49,12 +49,10 @@
         symbol.setDontDeadStrip();
     if ( cold )
         symbol.setCold();
-    if ( isThumb )
-        symbol.setIsThumb();
-    return symbol;
-}
-
-Symbol Symbol::makeRegularHidden(CString name, uint64_t imageOffset, uint8_t sectNum, bool dontDeadStrip, bool cold, bool isThumb)
+    return symbol;
+}
+
+Symbol Symbol::makeRegularHidden(CString name, uint64_t imageOffset, uint8_t sectNum, bool dontDeadStrip, bool cold)
 {
     Symbol symbol(name);
     symbol._kind        = Kind::regular;
@@ -65,12 +63,10 @@
         symbol.setDontDeadStrip();
     if ( cold )
         symbol.setCold();
-    if ( isThumb )
-        symbol.setIsThumb();
-    return symbol;
-}
-
-Symbol Symbol::makeRegularLocal(CString name, uint64_t imageOffset, uint8_t sectNum, bool dontDeadStrip, bool cold, bool isThumb)
+    return symbol;
+}
+
+Symbol Symbol::makeRegularLocal(CString name, uint64_t imageOffset, uint8_t sectNum, bool dontDeadStrip, bool cold)
 {
     Symbol symbol(name);
     symbol._kind        = Kind::regular;
@@ -81,12 +77,10 @@
         symbol.setDontDeadStrip();
     if ( cold )
         symbol.setCold();
-    if ( isThumb )
-        symbol.setIsThumb();
-    return symbol;
-}
-
-Symbol Symbol::makeRegularWasPrivateExtern(CString name, uint64_t imageOffset, uint8_t sectNum, bool dontDeadStrip, bool cold, bool isThumb)
+    return symbol;
+}
+
+Symbol Symbol::makeRegularWasPrivateExtern(CString name, uint64_t imageOffset, uint8_t sectNum, bool dontDeadStrip, bool cold)
 {
     Symbol symbol(name);
     symbol._kind        = Kind::regular;
@@ -97,12 +91,10 @@
         symbol.setDontDeadStrip();
     if ( cold )
         symbol.setCold();
-    if ( isThumb )
-        symbol.setIsThumb();
-    return symbol;
-}
-
-Symbol Symbol::makeWeakDefExport(CString name, uint64_t imageOffset, uint8_t sectOrd, bool dontDeadStrip, bool cold, bool isThumb)
+    return symbol;
+}
+
+Symbol Symbol::makeWeakDefExport(CString name, uint64_t imageOffset, uint8_t sectOrd, bool dontDeadStrip, bool cold)
 {
     Symbol symbol(name);
     symbol._kind        = Kind::regular;
@@ -114,12 +106,10 @@
         symbol.setDontDeadStrip();
     if ( cold )
         symbol.setCold();
-    if ( isThumb )
-        symbol.setIsThumb();
-    return symbol;
-}
-
-Symbol Symbol::makeWeakDefAutoHide(CString name, uint64_t imageOffset, uint8_t sectOrd, bool dontDeadStrip, bool cold, bool isThumb)
+    return symbol;
+}
+
+Symbol Symbol::makeWeakDefAutoHide(CString name, uint64_t imageOffset, uint8_t sectOrd, bool dontDeadStrip, bool cold)
 {
     Symbol symbol(name);
     symbol._kind        = Kind::regular;
@@ -131,12 +121,10 @@
         symbol.setDontDeadStrip();
     if ( cold )
         symbol.setCold();
-    if ( isThumb )
-        symbol.setIsThumb();
-    return symbol;
-}
-
-Symbol Symbol::makeWeakDefHidden(CString name, uint64_t imageOffset, uint8_t sectOrd, bool dontDeadStrip, bool cold, bool isThumb)
+    return symbol;
+}
+
+Symbol Symbol::makeWeakDefHidden(CString name, uint64_t imageOffset, uint8_t sectOrd, bool dontDeadStrip, bool cold)
 {
     Symbol symbol(name);
     symbol._kind        = Kind::regular;
@@ -148,12 +136,10 @@
         symbol.setDontDeadStrip();
     if ( cold )
         symbol.setCold();
-    if ( isThumb )
-        symbol.setIsThumb();
-    return symbol;
-}
-
-Symbol Symbol::makeWeakDefWasPrivateExtern(CString name, uint64_t imageOffset, uint8_t sectOrd, bool dontDeadStrip, bool cold, bool isThumb)
+    return symbol;
+}
+
+Symbol Symbol::makeWeakDefWasPrivateExtern(CString name, uint64_t imageOffset, uint8_t sectOrd, bool dontDeadStrip, bool cold)
 {
     Symbol symbol(name);
     symbol._kind        = Kind::regular;
@@ -165,12 +151,10 @@
         symbol.setDontDeadStrip();
     if ( cold )
         symbol.setCold();
-    if ( isThumb )
-        symbol.setIsThumb();
-    return symbol;
-}
-
-Symbol Symbol::makeAltEntry(CString name, uint64_t imageOffset, uint8_t sectOrd, Scope scope, bool dontDeadStrip, bool cold, bool weakDef, bool isThumb)
+    return symbol;
+}
+
+Symbol Symbol::makeAltEntry(CString name, uint64_t imageOffset, uint8_t sectOrd, Scope scope, bool dontDeadStrip, bool cold, bool weakDef)
 {
     Symbol symbol(name);
     symbol._kind        = Kind::altEntry;
@@ -182,34 +166,21 @@
         symbol.setDontDeadStrip();
     if ( cold )
         symbol.setCold();
-    if ( isThumb )
-        symbol.setIsThumb();
-    return symbol;
-}
-
-Symbol Symbol::makeDynamicResolver(CString name, uint8_t sectNum, uint64_t stubImageOffset, uint64_t funcImageOffset, Symbol::Scope scope)
+    return symbol;
+}
+
+Symbol Symbol::makeDynamicResolver(CString name, uint8_t sectNum, uint64_t stubImageOffset, uint64_t funcImageOffset)
 {
     // FIXME: do we need to support non-exported resolver functions?
     Symbol symbol(name);
     symbol._kind        = Kind::resolver;
-    symbol._scope       = scope;
+    symbol._scope       = Scope::global;
     symbol._sectOrdinal = sectNum;
     symbol._implOffset  = funcImageOffset;
     symbol._u.resolverStubOffset = stubImageOffset;
     return symbol;
 }
 
-Symbol Symbol::makeFunctionVariantExport(CString name, uint8_t sectNumOfDefault, uint64_t imageOffsetOfDefault, uint32_t functionVariantTableIndex)
-{
-    Symbol symbol(name);
-    symbol._kind        = Kind::functionVariant;
-    symbol._scope       = Scope::global;
-    symbol._sectOrdinal = sectNumOfDefault;
-    symbol._implOffset  = imageOffsetOfDefault;
-    symbol._u.functionVariantTableIndex = functionVariantTableIndex;
-    return symbol;
-}
-
 Symbol Symbol::makeThreadLocalExport(CString name, uint64_t imageOffset, uint8_t sectOrd, bool dontDeadStrip, bool cold, bool weakDef)
 {
     Symbol symbol(name);
@@ -225,13 +196,23 @@
     return symbol;
 }
 
-Symbol Symbol::makeAbsolute(CString name, uint64_t address, bool dontDeadStrip, Scope scope, uint8_t sectNum)
+Symbol Symbol::makeAbsoluteExport(CString name, uint64_t address, bool dontDeadStrip)
 {
     Symbol symbol(name);
     symbol._kind        = Kind::absolute;
-    symbol._scope       = scope;
+    symbol._scope       = Scope::global;
     symbol._implOffset  = address;
-    symbol._sectOrdinal = sectNum;
+    if ( dontDeadStrip )
+        symbol.setDontDeadStrip();
+    return symbol;
+}
+
+Symbol Symbol::makeAbsoluteLocal(CString name, uint64_t address, bool dontDeadStrip)
+{
+    Symbol symbol(name);
+    symbol._kind        = Kind::absolute;
+    symbol._scope       = Scope::translationUnit;
+    symbol._implOffset  = address;
     if ( dontDeadStrip )
         symbol.setDontDeadStrip();
     return symbol;
@@ -325,14 +306,6 @@
     return true;
 }
 
-bool Symbol::isFunctionVariant(uint32_t& functionVariantTableIndex) const
-{
-    if ( _kind != Kind::functionVariant )
-        return false;
-    functionVariantTableIndex = _u.functionVariantTableIndex;
-    return true;
-}
-
 bool Symbol::isReExport(int& libOrdinal, const char*& importName) const
 {
     if ( _kind != Kind::reExport )
@@ -412,15 +385,5 @@
     _implOffset = newOffset;
 }
 
-void Symbol::changeRegularToAltEntry()
-{
-    assert(_kind == Kind::regular && "only regular symbols can be changed to an alt entry");
-    _kind = Kind::altEntry;
-}
-
-void Symbol::changeAltEntryToRegular()
-{
-    assert(_kind == Kind::altEntry && "only altEntry symbols can be changed to regular");
-    _kind = Kind::regular;
-}
+
 } // namespace mach_o