[llvm-branch-commits] [llvm-branch] r119822 - in /llvm/branches/Apple/whitney: include/llvm/MC/MCAsmInfo.h include/llvm/MC/MCDirectives.h include/llvm/MC/MCMachOSymbolFlags.h lib/MC/MCAsmInfo.cpp lib/MC/MCAsmInfoDarwin.cpp lib/MC/MCAsmStreamer.cpp lib/MC/MCELFStreamer.cpp lib/MC/MCMachOStreamer.cpp lib/MC/MCParser/AsmParser.cpp test/MC/MachO/symbol-flags.s
Daniel Dunbar
daniel at zuster.org
Fri Nov 19 11:49:04 PST 2010
Author: ddunbar
Date: Fri Nov 19 13:49:04 2010
New Revision: 119822
URL: http://llvm.org/viewvc/llvm-project?rev=119822&view=rev
Log:
Merge r119816:
--
Author: Kevin Enderby <enderby at apple.com>
Date: Fri Nov 19 18:39:33 2010 +0000
Added support for the Mach-O .symbol_resolver directive. rdar://8673046
Modified:
llvm/branches/Apple/whitney/include/llvm/MC/MCAsmInfo.h
llvm/branches/Apple/whitney/include/llvm/MC/MCDirectives.h
llvm/branches/Apple/whitney/include/llvm/MC/MCMachOSymbolFlags.h
llvm/branches/Apple/whitney/lib/MC/MCAsmInfo.cpp
llvm/branches/Apple/whitney/lib/MC/MCAsmInfoDarwin.cpp
llvm/branches/Apple/whitney/lib/MC/MCAsmStreamer.cpp
llvm/branches/Apple/whitney/lib/MC/MCELFStreamer.cpp
llvm/branches/Apple/whitney/lib/MC/MCMachOStreamer.cpp
llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp
llvm/branches/Apple/whitney/test/MC/MachO/symbol-flags.s
Modified: llvm/branches/Apple/whitney/include/llvm/MC/MCAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/include/llvm/MC/MCAsmInfo.h?rev=119822&r1=119821&r2=119822&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/include/llvm/MC/MCAsmInfo.h (original)
+++ llvm/branches/Apple/whitney/include/llvm/MC/MCAsmInfo.h Fri Nov 19 13:49:04 2010
@@ -212,6 +212,10 @@
/// directive.
bool HasNoDeadStrip; // Defaults to false.
+ /// HasSymbolResolver - True if this target supports the MachO
+ /// .symbol_resolver directive.
+ bool HasSymbolResolver; // Defaults to false.
+
/// WeakRefDirective - This directive, if non-null, is used to declare a
/// global as being a weak undefined symbol.
const char *WeakRefDirective; // Defaults to NULL.
@@ -399,6 +403,7 @@
}
bool hasSingleParameterDotFile() const { return HasSingleParameterDotFile; }
bool hasNoDeadStrip() const { return HasNoDeadStrip; }
+ bool hasSymbolResolver() const { return HasSymbolResolver; }
const char *getWeakRefDirective() const { return WeakRefDirective; }
const char *getWeakDefDirective() const { return WeakDefDirective; }
const char *getLinkOnceDirective() const { return LinkOnceDirective; }
Modified: llvm/branches/Apple/whitney/include/llvm/MC/MCDirectives.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/include/llvm/MC/MCDirectives.h?rev=119822&r1=119821&r2=119822&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/include/llvm/MC/MCDirectives.h (original)
+++ llvm/branches/Apple/whitney/include/llvm/MC/MCDirectives.h Fri Nov 19 13:49:04 2010
@@ -33,6 +33,7 @@
MCSA_LazyReference, ///< .lazy_reference (MachO)
MCSA_Local, ///< .local (ELF)
MCSA_NoDeadStrip, ///< .no_dead_strip (MachO)
+ MCSA_SymbolResolver, ///< .symbol_resolver (MachO)
MCSA_PrivateExtern, ///< .private_extern (MachO)
MCSA_Protected, ///< .protected (ELF)
MCSA_Reference, ///< .reference (MachO)
Modified: llvm/branches/Apple/whitney/include/llvm/MC/MCMachOSymbolFlags.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/include/llvm/MC/MCMachOSymbolFlags.h?rev=119822&r1=119821&r2=119822&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/include/llvm/MC/MCMachOSymbolFlags.h (original)
+++ llvm/branches/Apple/whitney/include/llvm/MC/MCMachOSymbolFlags.h Fri Nov 19 13:49:04 2010
@@ -36,7 +36,8 @@
// Other 'desc' flags.
SF_NoDeadStrip = 0x0020,
SF_WeakReference = 0x0040,
- SF_WeakDefinition = 0x0080
+ SF_WeakDefinition = 0x0080,
+ SF_SymbolResolver = 0x0100
};
} // end namespace llvm
Modified: llvm/branches/Apple/whitney/lib/MC/MCAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/MC/MCAsmInfo.cpp?rev=119822&r1=119821&r2=119822&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/MC/MCAsmInfo.cpp (original)
+++ llvm/branches/Apple/whitney/lib/MC/MCAsmInfo.cpp Fri Nov 19 13:49:04 2010
@@ -58,6 +58,7 @@
HasDotTypeDotSizeDirective = true;
HasSingleParameterDotFile = true;
HasNoDeadStrip = false;
+ HasSymbolResolver = false;
WeakRefDirective = 0;
WeakDefDirective = 0;
LinkOnceDirective = 0;
Modified: llvm/branches/Apple/whitney/lib/MC/MCAsmInfoDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/MC/MCAsmInfoDarwin.cpp?rev=119822&r1=119821&r2=119822&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/MC/MCAsmInfoDarwin.cpp (original)
+++ llvm/branches/Apple/whitney/lib/MC/MCAsmInfoDarwin.cpp Fri Nov 19 13:49:04 2010
@@ -44,6 +44,7 @@
HasDotTypeDotSizeDirective = false;
HasNoDeadStrip = true;
+ HasSymbolResolver = true;
DwarfUsesAbsoluteLabelForStmtList = false;
DwarfUsesLabelOffsetForRanges = false;
Modified: llvm/branches/Apple/whitney/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/MC/MCAsmStreamer.cpp?rev=119822&r1=119821&r2=119822&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/branches/Apple/whitney/lib/MC/MCAsmStreamer.cpp Fri Nov 19 13:49:04 2010
@@ -291,6 +291,7 @@
case MCSA_LazyReference: OS << "\t.lazy_reference\t"; break;
case MCSA_Local: OS << "\t.local\t"; break;
case MCSA_NoDeadStrip: OS << "\t.no_dead_strip\t"; break;
+ case MCSA_SymbolResolver: OS << "\t.symbol_resolver\t"; break;
case MCSA_PrivateExtern: OS << "\t.private_extern\t"; break;
case MCSA_Protected: OS << "\t.protected\t"; break;
case MCSA_Reference: OS << "\t.reference\t"; break;
Modified: llvm/branches/Apple/whitney/lib/MC/MCELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/MC/MCELFStreamer.cpp?rev=119822&r1=119821&r2=119822&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/MC/MCELFStreamer.cpp (original)
+++ llvm/branches/Apple/whitney/lib/MC/MCELFStreamer.cpp Fri Nov 19 13:49:04 2010
@@ -254,6 +254,7 @@
case MCSA_LazyReference:
case MCSA_Reference:
case MCSA_NoDeadStrip:
+ case MCSA_SymbolResolver:
case MCSA_PrivateExtern:
case MCSA_WeakDefinition:
case MCSA_WeakDefAutoPrivate:
Modified: llvm/branches/Apple/whitney/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/MC/MCMachOStreamer.cpp?rev=119822&r1=119821&r2=119822&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/branches/Apple/whitney/lib/MC/MCMachOStreamer.cpp Fri Nov 19 13:49:04 2010
@@ -234,6 +234,10 @@
SD.setFlags(SD.getFlags() | SF_NoDeadStrip);
break;
+ case MCSA_SymbolResolver:
+ SD.setFlags(SD.getFlags() | SF_SymbolResolver);
+ break;
+
case MCSA_PrivateExtern:
SD.setExternal(true);
SD.setPrivateExtern(true);
Modified: llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp?rev=119822&r1=119821&r2=119822&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp Fri Nov 19 13:49:04 2010
@@ -986,6 +986,8 @@
return ParseDirectiveSymbolAttribute(MCSA_LazyReference);
if (IDVal == ".no_dead_strip")
return ParseDirectiveSymbolAttribute(MCSA_NoDeadStrip);
+ if (IDVal == ".symbol_resolver")
+ return ParseDirectiveSymbolAttribute(MCSA_SymbolResolver);
if (IDVal == ".private_extern")
return ParseDirectiveSymbolAttribute(MCSA_PrivateExtern);
if (IDVal == ".protected")
Modified: llvm/branches/Apple/whitney/test/MC/MachO/symbol-flags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/test/MC/MachO/symbol-flags.s?rev=119822&r1=119821&r2=119822&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/test/MC/MachO/symbol-flags.s (original)
+++ llvm/branches/Apple/whitney/test/MC/MachO/symbol-flags.s Fri Nov 19 13:49:04 2010
@@ -49,6 +49,9 @@
.no_dead_strip sym_no_dead_strip_A
+sym_symbol_resolver_A:
+ .symbol_resolver sym_symbol_resolver_A
+
.reference sym_ref_A
.desc sym_ref_A, 1
.desc sym_ref_A, 0x1234
@@ -112,10 +115,10 @@
// CHECK: (('command', 2)
// CHECK: ('size', 24)
// CHECK: ('symoff', 324)
-// CHECK: ('nsyms', 23)
-// CHECK: ('stroff', 600)
-// CHECK: ('strsize', 368)
-// CHECK: ('_string_data', '\x00sym_ref_A\x00sym_ref_def_D\x00sym_ref_def_E\x00sym_weak_ref_A\x00sym_weak_def_A\x00sym_weak_def_B\x00sym_weak_def_C\x00sym_lazy_ref_A\x00sym_lazy_ref_D\x00sym_lazy_ref_E\x00sym_private_ext_A\x00sym_private_ext_B\x00sym_private_ext_C\x00sym_private_ext_D\x00sym_private_ext_E\x00sym_no_dead_strip_A\x00sym_ref_def_A\x00sym_ref_def_C\x00sym_weak_ref_def_A\x00sym_weak_ref_def_B\x00sym_lazy_ref_B\x00sym_lazy_ref_C\x00sym_desc_flags\x00\x00\x00\x00')
+// CHECK: ('nsyms', 24)
+// CHECK: ('stroff', 612)
+// CHECK: ('strsize', 388)
+// CHECK: ('_string_data', '\x00sym_ref_A\x00sym_ref_def_D\x00sym_ref_def_E\x00sym_weak_ref_A\x00sym_weak_def_A\x00sym_weak_def_B\x00sym_weak_def_C\x00sym_lazy_ref_A\x00sym_lazy_ref_D\x00sym_lazy_ref_E\x00sym_private_ext_A\x00sym_private_ext_B\x00sym_private_ext_C\x00sym_private_ext_D\x00sym_private_ext_E\x00sym_no_dead_strip_A\x00sym_ref_def_A\x00sym_ref_def_C\x00sym_weak_ref_def_A\x00sym_weak_ref_def_B\x00sym_lazy_ref_B\x00sym_lazy_ref_C\x00sym_symbol_resolver_A\x00sym_desc_flags\x00\x00')
// CHECK: ('_symbols', [
// CHECK: # Symbol 0
// CHECK: (('n_strx', 254)
@@ -169,11 +172,19 @@
// CHECK: (('n_strx', 350)
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 256)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', 'sym_symbol_resolver_A')
+// CHECK: ),
+// CHECK: # Symbol 7
+// CHECK: (('n_strx', 372)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 64)
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_desc_flags')
// CHECK: ),
-// CHECK: # Symbol 7
+// CHECK: # Symbol 8
// CHECK: (('n_strx', 162)
// CHECK: ('n_type', 0x1f)
// CHECK: ('n_sect', 2)
@@ -181,7 +192,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_private_ext_B')
// CHECK: ),
-// CHECK: # Symbol 8
+// CHECK: # Symbol 9
// CHECK: (('n_strx', 180)
// CHECK: ('n_type', 0x1f)
// CHECK: ('n_sect', 2)
@@ -189,7 +200,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_private_ext_C')
// CHECK: ),
-// CHECK: # Symbol 9
+// CHECK: # Symbol 10
// CHECK: (('n_strx', 54)
// CHECK: ('n_type', 0xf)
// CHECK: ('n_sect', 2)
@@ -197,7 +208,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_weak_def_A')
// CHECK: ),
-// CHECK: # Symbol 10
+// CHECK: # Symbol 11
// CHECK: (('n_strx', 69)
// CHECK: ('n_type', 0xf)
// CHECK: ('n_sect', 2)
@@ -205,7 +216,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_weak_def_B')
// CHECK: ),
-// CHECK: # Symbol 11
+// CHECK: # Symbol 12
// CHECK: (('n_strx', 84)
// CHECK: ('n_type', 0xf)
// CHECK: ('n_sect', 2)
@@ -213,7 +224,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_weak_def_C')
// CHECK: ),
-// CHECK: # Symbol 12
+// CHECK: # Symbol 13
// CHECK: (('n_strx', 99)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
@@ -221,7 +232,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_lazy_ref_A')
// CHECK: ),
-// CHECK: # Symbol 13
+// CHECK: # Symbol 14
// CHECK: (('n_strx', 114)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
@@ -229,7 +240,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_lazy_ref_D')
// CHECK: ),
-// CHECK: # Symbol 14
+// CHECK: # Symbol 15
// CHECK: (('n_strx', 129)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
@@ -237,7 +248,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_lazy_ref_E')
// CHECK: ),
-// CHECK: # Symbol 15
+// CHECK: # Symbol 16
// CHECK: (('n_strx', 234)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
@@ -245,7 +256,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_no_dead_strip_A')
// CHECK: ),
-// CHECK: # Symbol 16
+// CHECK: # Symbol 17
// CHECK: (('n_strx', 144)
// CHECK: ('n_type', 0x11)
// CHECK: ('n_sect', 0)
@@ -253,7 +264,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_private_ext_A')
// CHECK: ),
-// CHECK: # Symbol 17
+// CHECK: # Symbol 18
// CHECK: (('n_strx', 198)
// CHECK: ('n_type', 0x11)
// CHECK: ('n_sect', 0)
@@ -261,7 +272,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_private_ext_D')
// CHECK: ),
-// CHECK: # Symbol 18
+// CHECK: # Symbol 19
// CHECK: (('n_strx', 216)
// CHECK: ('n_type', 0x11)
// CHECK: ('n_sect', 0)
@@ -269,7 +280,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_private_ext_E')
// CHECK: ),
-// CHECK: # Symbol 19
+// CHECK: # Symbol 20
// CHECK: (('n_strx', 1)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
@@ -277,7 +288,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_ref_A')
// CHECK: ),
-// CHECK: # Symbol 20
+// CHECK: # Symbol 21
// CHECK: (('n_strx', 11)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
@@ -285,7 +296,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_ref_def_D')
// CHECK: ),
-// CHECK: # Symbol 21
+// CHECK: # Symbol 22
// CHECK: (('n_strx', 25)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
@@ -293,7 +304,7 @@
// CHECK: ('n_value', 0)
// CHECK: ('_string', 'sym_ref_def_E')
// CHECK: ),
-// CHECK: # Symbol 22
+// CHECK: # Symbol 23
// CHECK: (('n_strx', 39)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
@@ -307,10 +318,10 @@
// CHECK: (('command', 11)
// CHECK: ('size', 80)
// CHECK: ('ilocalsym', 0)
-// CHECK: ('nlocalsym', 7)
-// CHECK: ('iextdefsym', 7)
+// CHECK: ('nlocalsym', 8)
+// CHECK: ('iextdefsym', 8)
// CHECK: ('nextdefsym', 5)
-// CHECK: ('iundefsym', 12)
+// CHECK: ('iundefsym', 13)
// CHECK: ('nundefsym', 11)
// CHECK: ('tocoff', 0)
// CHECK: ('ntoc', 0)
More information about the llvm-branch-commits
mailing list