Make all temporary symbols unnamed.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 19 Jun 2015 12:16:55 +0000 (12:16 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 19 Jun 2015 12:16:55 +0000 (12:16 +0000)
What this does is make all symbols that would otherwise start with a .L
(or L on MachO) unnamed.

Some of these symbols still show up in the symbol table, but we can just
make them unnamed.

In order to make sure we produce identical results when going thought assembly,
all .L (not just the compiler produced ones), are now unnamed.

Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to
205.57MB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240130 91177308-0d34-0410-b5e6-96231b3b80d8

25 files changed:
include/llvm/MC/MCContext.h
lib/MC/ELFObjectWriter.cpp
lib/MC/MCContext.cpp
lib/MC/MachObjectWriter.cpp
test/CodeGen/SPARC/obj-relocs.ll
test/MC/ARM/elf-reloc-02.s
test/MC/ELF/basic-elf-32.s
test/MC/ELF/compression.s
test/MC/ELF/discriminator.s
test/MC/ELF/merge.s
test/MC/ELF/relocation-386.s
test/MC/ELF/undef-temp.s [new file with mode: 0644]
test/MC/ELF/undef.s
test/MC/ELF/undef2.s [deleted file]
test/MC/MachO/AArch64/classrefs.s
test/MC/MachO/AArch64/darwin-ARM64-reloc.s
test/MC/MachO/AArch64/ld64-workaround.s
test/MC/MachO/AArch64/mergeable.s
test/MC/MachO/AArch64/reloc-crash.s
test/MC/MachO/x86_64-mergeable.s
test/MC/MachO/x86_64-symbols.s
test/MC/Mips/cpsetup.s
test/MC/Mips/elf-relsym.s
test/MC/Mips/xgot.s
test/MC/Sparc/sparc-pic.s

index 52017fda189bfa1b0689b3821d9790e4ea6f0236..99b8a5c6327b4dd99f3e389290b24eec96624454 100644 (file)
@@ -208,8 +208,7 @@ namespace llvm {
 
     MCSymbol *createSymbolImpl(const StringMapEntry<bool> *Name,
                                bool CanBeUnnamed);
-    MCSymbol *createSymbol(StringRef Name, bool AlwaysAddSuffix,
-                           bool IsTemporary);
+    MCSymbol *createSymbol(StringRef Name, bool AlwaysAddSuffix);
 
     MCSymbol *getOrCreateDirectionalLocalSymbol(unsigned LocalLabelVal,
                                                 unsigned Instance);
@@ -249,10 +248,9 @@ namespace llvm {
 
     /// Create and return a new assembler temporary symbol with a unique but
     /// unspecified name.
-    MCSymbol *createTempSymbol(bool CanBeUnnamed = true);
+    MCSymbol *createTempSymbol();
 
-    MCSymbol *createTempSymbol(const Twine &Name, bool AlwaysAddSuffix,
-                               bool CanBeUnnamed = true);
+    MCSymbol *createTempSymbol(const Twine &Name, bool AlwaysAddSuffix);
 
     /// Create the definition of a directional local symbol for numbered label
     /// (used for "1:" definitions).
index 0765937d0ea852bd46e1e666b411a3b642af6458..bbf0b2b69d3c8b3abdf62b16d5e1a6533c551525 100644 (file)
@@ -786,10 +786,15 @@ void ELFObjectWriter::computeSymbolTable(
                     Renames.count(&Symbol)))
       continue;
 
+    if (Symbol.isTemporary() && Symbol.isUndefined())
+      Ctx.reportFatalError(SMLoc(), "Undefined temporary");
+
     ELFSymbolData MSD;
     MSD.Symbol = cast<MCSymbolELF>(&Symbol);
 
     bool Local = Symbol.getBinding() == ELF::STB_LOCAL;
+    assert(Local || !Symbol.isTemporary());
+
     if (Symbol.isAbsolute()) {
       MSD.SectionIndex = ELF::SHN_ABS;
     } else if (Symbol.isCommon()) {
@@ -888,9 +893,11 @@ void ELFObjectWriter::computeSymbolTable(
   unsigned Index = FileNames.size() + 1;
 
   for (ELFSymbolData &MSD : LocalSymbolData) {
-    unsigned StringIndex = MSD.Symbol->getType() == ELF::STT_SECTION
-                               ? 0
-                               : StrTabBuilder.getOffset(MSD.Name);
+    unsigned StringIndex;
+    if (MSD.Symbol->getType() == ELF::STT_SECTION || MSD.Name.empty())
+      StringIndex = 0;
+    else
+      StringIndex = StrTabBuilder.getOffset(MSD.Name);
     MSD.Symbol->setIndex(Index++);
     writeSymbol(Writer, StringIndex, MSD, Layout);
   }
index c601c56f3952d1406f24ab1954d989af18758466..01074eb5e790502b0e760b3d6770b9fa8a6d33b0 100644 (file)
@@ -116,7 +116,7 @@ MCSymbol *MCContext::getOrCreateSymbol(const Twine &Name) {
 
   MCSymbol *&Sym = Symbols[NameRef];
   if (!Sym)
-    Sym = createSymbol(NameRef, false, false);
+    Sym = createSymbol(NameRef, false);
 
   return Sym;
 }
@@ -175,17 +175,16 @@ MCSymbol *MCContext::createSymbolImpl(const StringMapEntry<bool> *Name,
                                     IsTemporary);
 }
 
-MCSymbol *MCContext::createSymbol(StringRef Name, bool AlwaysAddSuffix,
-                                  bool CanBeUnnamed) {
-  if (CanBeUnnamed && !UseNamesOnTempLabels)
-    return createSymbolImpl(nullptr, true);
-
+MCSymbol *MCContext::createSymbol(StringRef Name, bool AlwaysAddSuffix) {
   // Determine whether this is an user writter assembler temporary or normal
   // label, if used.
-  bool IsTemporary = CanBeUnnamed;
-  if (AllowTemporaryLabels && !IsTemporary)
+  bool IsTemporary = false;
+  if (AllowTemporaryLabels)
     IsTemporary = Name.startswith(MAI->getPrivateGlobalPrefix());
 
+  if (IsTemporary && !UseNamesOnTempLabels)
+    return createSymbolImpl(nullptr, true);
+
   SmallString<128> NewName = Name;
   bool AddSuffix = AlwaysAddSuffix;
   unsigned &NextUniqueID = NextID[Name];
@@ -206,21 +205,20 @@ MCSymbol *MCContext::createSymbol(StringRef Name, bool AlwaysAddSuffix,
   llvm_unreachable("Infinite loop");
 }
 
-MCSymbol *MCContext::createTempSymbol(const Twine &Name, bool AlwaysAddSuffix,
-                                      bool CanBeUnnamed) {
+MCSymbol *MCContext::createTempSymbol(const Twine &Name, bool AlwaysAddSuffix) {
   SmallString<128> NameSV;
   raw_svector_ostream(NameSV) << MAI->getPrivateGlobalPrefix() << Name;
-  return createSymbol(NameSV, AlwaysAddSuffix, CanBeUnnamed);
+  return createSymbol(NameSV, AlwaysAddSuffix);
 }
 
 MCSymbol *MCContext::createLinkerPrivateTempSymbol() {
   SmallString<128> NameSV;
   raw_svector_ostream(NameSV) << MAI->getLinkerPrivateGlobalPrefix() << "tmp";
-  return createSymbol(NameSV, true, false);
+  return createSymbol(NameSV, true);
 }
 
-MCSymbol *MCContext::createTempSymbol(bool CanBeUnnamed) {
-  return createTempSymbol("tmp", true, CanBeUnnamed);
+MCSymbol *MCContext::createTempSymbol() {
+  return createTempSymbol("tmp", true);
 }
 
 unsigned MCContext::NextInstance(unsigned LocalLabelVal) {
@@ -241,7 +239,7 @@ MCSymbol *MCContext::getOrCreateDirectionalLocalSymbol(unsigned LocalLabelVal,
                                                        unsigned Instance) {
   MCSymbol *&Sym = LocalSymbols[std::make_pair(LocalLabelVal, Instance)];
   if (!Sym)
-    Sym = createTempSymbol(false);
+    Sym = createTempSymbol();
   return Sym;
 }
 
index 8ce6127e386659ebc331d4974e5c486fc58643c2..d7934ad80c64f42734d47eb6811522de547889c1 100644 (file)
@@ -565,7 +565,8 @@ void MachObjectWriter::computeSymbolTable(
 
     MachSymbolData MSD;
     MSD.Symbol = &Symbol;
-    MSD.StringIndex = StringTable.getOffset(Symbol.getName());
+    StringRef Name = Symbol.getName();
+    MSD.StringIndex = Name.empty() ? 0 : StringTable.getOffset(Name);
 
     if (Symbol.isAbsolute()) {
       MSD.SectionIndex = 0;
index 0e7e04032be07d9b6761463ca4f3784bbdee9d43..17734f6e53eaa290d459c422a968c482fe13ba4d 100644 (file)
@@ -16,8 +16,8 @@
 ; CHECK-PIC-NEXT:    0x{{[0-9,A-F]+}} R_SPARC_PC10 _GLOBAL_OFFSET_TABLE_ 0x8
 ; CHECK-PIC-NEXT:    0x{{[0-9,A-F]+}} R_SPARC_GOT22 AGlobalVar 0x0
 ; CHECK-PIC-NEXT:    0x{{[0-9,A-F]+}} R_SPARC_GOT10 AGlobalVar 0x0
-; CHECK-PIC-NEXT:    0x{{[0-9,A-F]+}} R_SPARC_GOT22 .L.mystr 0x0
-; CHECK-PIC-NEXT:    0x{{[0-9,A-F]+}} R_SPARC_GOT10 .L.mystr 0x0
+; CHECK-PIC-NEXT:    0x{{[0-9,A-F]+}} R_SPARC_GOT22 - 0x0
+; CHECK-PIC-NEXT:    0x{{[0-9,A-F]+}} R_SPARC_GOT10 - 0x0
 ; CHECK-PIC-NEXT:    0x{{[0-9,A-F]+}} R_SPARC_WPLT30 bar 0x0
 ; CHECK-PIC:      ]
 
index 24e2bb3b6fdb7d61cbc9c00cf4f708ac315f2239..a616f4617a5eeb9f7be9e62bc49045891a5270b2 100644 (file)
@@ -22,6 +22,6 @@
 
 // OBJ:      Relocations [
 // OBJ:        Section {{.*}} .rel.text {
-// OBJ-NEXT:     0x{{[0-9,A-F]+}} R_ARM_MOVW_ABS_NC .L.str
+// OBJ-NEXT:     0x{{[0-9,A-F]+}} R_ARM_MOVW_ABS_NC -
 // OBJ:        }
 // OBJ:      ]
index 1036b04a747bcbe1a6e66d9eb4e71ab51933368b..cc6b70c2bedfddc5d764d721d73603a9fa8ae19b 100644 (file)
@@ -46,9 +46,9 @@ main:                                   # @main
 
 // CHECK: Relocations [
 // CHECK:   Section {{.*}} .rel.text {
-// CHECK:     0x6  R_386_32   .L.str1
+// CHECK:     0x6  R_386_32   -
 // CHECK:     0xB  R_386_PC32 puts
-// CHECK:     0x12 R_386_32   .L.str2
+// CHECK:     0x12 R_386_32   -
 // CHECK:     0x17 R_386_PC32 puts
 // CHECK:   }
 // CHECK: ]
index 5560ba78c68fa39e31ab2c097c1add6154a1666b..12cab4bfc8fb6c92d13c67ad699160c4cb16e1a1 100644 (file)
 
 // In x86 32 bit named symbols are used for temporary symbols in merge
 // sections, so make sure we handle symbols inside compressed sections
-// 386-SYMBOLS: Name: .Linfo_string0
-// 386-SYMBOLS-NOT: }
-// 386-SYMBOLS: Section: .zdebug_str
+// 386-SYMBOLS:        Symbol {
+// 386-SYMBOLS-NEXT:    Name:  (0)
+// 386-SYMBOLS-NEXT:    Value: 0x0
+// 386-SYMBOLS-NEXT:    Size: 0
+// 386-SYMBOLS-NEXT:    Binding: Local (0x0)
+// 386-SYMBOLS-NEXT:    Type: None (0x0)
+// 386-SYMBOLS-NEXT:    Other: 0
+// 386-SYMBOLS-NEXT:    Section: Undefined (0x0)
+// 386-SYMBOLS-NEXT:  }
+// 386-SYMBOLS-NEXT:  Symbol {
+// 386-SYMBOLS-NEXT:    Name:  (0)
+// 386-SYMBOLS-NEXT:    Value: 0x0
+// 386-SYMBOLS-NEXT:    Size: 0
+// 386-SYMBOLS-NEXT:    Binding: Local (0x0)
+// 386-SYMBOLS-NEXT:    Type: None (0x0)
+// 386-SYMBOLS-NEXT:    Other: 0
+// 386-SYMBOLS-NEXT:    Section: .zdebug_str (0xA)
+// 386-SYMBOLS-NEXT:  }
 
        .section        .debug_line,"",@progbits
 
index 8a695b96ede12e4f0b75d979d5bc5d6defcc7143..75e4e86cee0f9f9204610143ca0a877529f46d34 100644 (file)
@@ -19,12 +19,12 @@ foo:
         .long   .L.debug_abbrev_begin   # Offset Into Abbrev. Section
         .byte   8                       # Address Size (in bytes)
         .byte   1                       # Abbrev [1] 0xb:0x1b DW_TAG_compile_unit
-        .long   .Linfo_string0          # DW_AT_producer
+        .long   info_string0            # DW_AT_producer
         .short  12                      # DW_AT_language
-        .long   .Linfo_string1          # DW_AT_name
+        .long   info_string1            # DW_AT_name
         .quad   0                       # DW_AT_low_pc
         .long   0                       # DW_AT_stmt_list
-        .long   .Linfo_string2          # DW_AT_comp_dir
+        .long   info_string2            # DW_AT_comp_dir
                                         # DW_AT_APPLE_optimized
         .section        .debug_abbrev,"",@progbits
 .L.debug_abbrev_begin:
index e787728ae19786e9dc721f843ee8a375ee769034..8fdb3a3a431b0bc10454260f3b1036ee406d865a 100644 (file)
@@ -22,9 +22,9 @@ foo:
 
 // CHECK:      Relocations [
 // CHECK-NEXT:   Section {{.*}} .rela.text {
-// CHECK-NEXT:     0x{{[^ ]+}} R_X86_64_PC32    .Lfoo 0x{{[^ ]+}}
+// CHECK-NEXT:     0x{{[^ ]+}} R_X86_64_PC32     -    0x{{[^ ]+}}
 // CHECK-NEXT:     0x{{[^ ]+}} R_X86_64_32      .sec1 0x{{[^ ]+}}
-// CHECK-NEXT:     0x{{[^ ]+}} R_X86_64_32      .Lfoo 0x{{[^ ]+}}
+// CHECK-NEXT:     0x{{[^ ]+}} R_X86_64_32       -    0x{{[^ ]+}}
 // CHECK-NEXT:     0x{{[^ ]+}} R_X86_64_PLT32    foo  0x{{[^ ]+}}
 // CHECK-NEXT:     0x{{[^ ]+}} R_X86_64_GOTPCREL foo  0x{{[^ ]+}}
 // CHECK-NEXT:     0x{{[^ ]+}} R_X86_64_32S      zed  0x{{[^ ]+}}
index 6b7e02f03ea0aa96bd9f1c89884fea1509ce5580..5ad1227b7590a6178c3f11b9d52e9fb43a5f72c3 100644 (file)
@@ -5,7 +5,7 @@
 
 // CHECK:      Relocations [
 // CHECK-NEXT:   Section {{.*}} .rel.text {
-// CHECK-NEXT:     0x2          R_386_GOTOFF     .Lfoo 0x0
+// CHECK-NEXT:     0x2          R_386_GOTOFF     - 0x0
 // CHECK-NEXT:     0x{{[^ ]+}}  R_386_PLT32      bar2 0x0
 // CHECK-NEXT:     0x{{[^ ]+}}  R_386_GOTPC      _GLOBAL_OFFSET_TABLE_ 0x0
 // Relocation 3 (bar3@GOTOFF) is done with symbol 7 (bss)
diff --git a/test/MC/ELF/undef-temp.s b/test/MC/ELF/undef-temp.s
new file mode 100644 (file)
index 0000000..45537a9
--- /dev/null
@@ -0,0 +1,4 @@
+// RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o - 2>&1 | FileCheck %s
+
+// CHECK: Undefined temporary
+        .long .Lfoo
index 9577ea22875b166cc5c99bb66c8e0498ed5f8a14..b491ba1527bb0b6c44037391e43a4e6b60fc5a67 100644 (file)
@@ -2,7 +2,6 @@
 
 // Test which symbols should be in the symbol table
 
-        .long  .Lsym1
 .Lsym2:
 .Lsym3:
 .Lsym4 = .Lsym2 - .Lsym3
@@ -33,7 +32,7 @@ test2_b = undef + 1
 // CHECK-NEXT:     Section: Undefined
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: .Lsym8
+// CHECK-NEXT:     Name: (0)
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:     Size: 0
 // CHECK-NEXT:     Binding: Local
@@ -42,15 +41,6 @@ test2_b = undef + 1
 // CHECK-NEXT:     Section: .rodata.str1.1
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: .Lsym1
-// CHECK-NEXT:     Value: 0x0
-// CHECK-NEXT:     Size: 0
-// CHECK-NEXT:     Binding: Global
-// CHECK-NEXT:     Type: None
-// CHECK-NEXT:     Other: 0
-// CHECK-NEXT:     Section: Undefined
-// CHECK-NEXT:   }
-// CHECK-NEXT:   Symbol {
 // CHECK-NEXT:     Name: sym6
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:     Size: 0
diff --git a/test/MC/ELF/undef2.s b/test/MC/ELF/undef2.s
deleted file mode 100644 (file)
index 6aa66c0..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s -t | FileCheck %s
-
-// Test that this produces an undefined reference to .Lfoo
-
-        je     .Lfoo
-
-// CHECK:       Section {
-// CHECK:         Name: .strtab
-
-// CHECK:       Symbol {
-// CHECK:         Name: .Lfoo
-// CHECK-NEXT:    Value:
-// CHECK-NEXT:    Size:
-// CHECK-NEXT:    Binding: Global
-// CHECK-NEXT:    Type:
-// CHECK-NEXT:    Other:
-// CHECK-NEXT:    Section:
-// CHECK-NEXT:  }
index d92bbb4a57abeef436a1498dc1879f1fd4915da2..e02df13eb6b86bc9fee766b6fb75101717cabe34 100644 (file)
@@ -10,7 +10,7 @@
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: Lbar
+// CHECK-NEXT:       Symbol: -
 // CHECK-NEXT:     }
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]
index b4d0b082c8a58046706d5ce0bfcdad9484c69d0e..1f384f92067723382588c0176ad2fc3402d2a8ae 100644 (file)
@@ -41,7 +41,7 @@ L_.str:
 ; CHECK-NEXT:       PCRel: 1
 ; CHECK-NEXT:       Length: 2
 ; CHECK-NEXT:       Type: ARM64_RELOC_PAGE21 (3)
-; CHECK-NEXT:       Symbol: L_.str
+; CHECK-NEXT:       Symbol: -
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:    Relocation {
 ; CHECK-NEXT:       Offset: 0x20
index 63f91705599cc72fa619e56a13d8b4f7994169e7..b619fda09815fae8bae8ecc614db6f4ce9f5152a 100644 (file)
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: Llit16
+// CHECK-NEXT:       Symbol: -
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x10
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: Llit8
+// CHECK-NEXT:       Symbol: -
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x8
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: Llit4
+// CHECK-NEXT:       Symbol: -
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x0
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: Lcfstring
+// CHECK-NEXT:       Symbol: -
 // CHECK-NEXT:     }
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]
index 4fed04c93346c9253555131773bfaed0f42e603c..f710344a1931e4ba16e6d0ee868cad2bcf71d296 100644 (file)
@@ -26,28 +26,28 @@ L1:
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: L1
+// CHECK-NEXT:       Symbol: -
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x10
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: L1
+// CHECK-NEXT:       Symbol: -
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x8
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: L0
+// CHECK-NEXT:       Symbol: -
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x0
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: L0
+// CHECK-NEXT:       Symbol: -
 // CHECK-NEXT:     }
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]
index f8ad4c4f751c435ecd8ad63e5b1082faa0c1a97b..946a57c91f943c7077c804729f9b9736113a769a 100644 (file)
@@ -10,7 +10,7 @@
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 3
 ; CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-; CHECK-NEXT:       Symbol: Lbar
+; CHECK-NEXT:       Symbol: -
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:   }
 ; CHECK-NEXT: ]
index b7933f92c0c4f2503d7ecd2f50a84451d2fdb32b..32f47146c678f0125d752ae251462c5280e8ca86 100644 (file)
@@ -24,7 +24,7 @@ L1:
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: L1
+// CHECK-NEXT:       Symbol: -
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x10
@@ -38,7 +38,7 @@ L1:
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: L0
+// CHECK-NEXT:       Symbol: -
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x0
index f40183df853c1270ce89f1c2b95ca21432fdaf6b..7aba6b73d102618198d77cd5b31d5373a031c3b9 100644 (file)
@@ -130,7 +130,7 @@ D38:
 
 // CHECK: Symbols [
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D0 (139)
+// CHECK-NEXT:     Name: D0 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __text (0x1)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -139,7 +139,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D1 (128)
+// CHECK-NEXT:     Name: D1 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __text (0x1)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -148,7 +148,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D2 (113)
+// CHECK-NEXT:     Name: D2 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __const (0x2)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -157,7 +157,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D3 (98)
+// CHECK-NEXT:     Name: D3 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __static_const (0x3)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -166,7 +166,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: L4 (84)
+// CHECK-NEXT:     Name: (0)
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __cstring (0x4)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -175,7 +175,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D4 (87)
+// CHECK-NEXT:     Name: D4 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __cstring (0x4)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -184,7 +184,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D5 (69)
+// CHECK-NEXT:     Name: D5 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __literal4 (0x5)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -193,7 +193,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D6 (50)
+// CHECK-NEXT:     Name: D6 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __literal8 (0x6)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -202,7 +202,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D7 (31)
+// CHECK-NEXT:     Name: D7 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __literal16 (0x7)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -211,7 +211,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D8 (12)
+// CHECK-NEXT:     Name: D8 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __constructor (0x8)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -220,7 +220,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D9 (1)
+// CHECK-NEXT:     Name: D9 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __destructor (0x9)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -229,7 +229,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D12 (124)
+// CHECK-NEXT:     Name: D12 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __data (0xA)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -238,7 +238,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D13 (109)
+// CHECK-NEXT:     Name: D13 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __static_data (0xB)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -247,7 +247,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D16 (65)
+// CHECK-NEXT:     Name: D16 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __dyld (0xC)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -256,7 +256,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D17 (46)
+// CHECK-NEXT:     Name: D17 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __mod_init_func (0xD)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -265,7 +265,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D18 (27)
+// CHECK-NEXT:     Name: D18 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __mod_term_func (0xE)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -283,7 +283,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D20 (146)
+// CHECK-NEXT:     Name: D20 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __class (0x10)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -292,7 +292,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D21 (135)
+// CHECK-NEXT:     Name: D21 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __meta_class (0x11)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -301,7 +301,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D22 (120)
+// CHECK-NEXT:     Name: D22 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __cat_cls_meth (0x12)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -310,7 +310,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D23 (105)
+// CHECK-NEXT:     Name: D23 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __cat_inst_meth (0x13)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -319,7 +319,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D24 (94)
+// CHECK-NEXT:     Name: D24 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __protocol (0x14)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -328,7 +328,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D25 (80)
+// CHECK-NEXT:     Name: D25 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __string_object (0x15)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -337,7 +337,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D26 (61)
+// CHECK-NEXT:     Name: D26 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __cls_meth (0x16)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -346,7 +346,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D27 (42)
+// CHECK-NEXT:     Name: D27 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __inst_meth (0x17)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -355,7 +355,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D28 (23)
+// CHECK-NEXT:     Name: D28 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __cls_refs (0x18)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -364,7 +364,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D29 (4)
+// CHECK-NEXT:     Name: D29 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __message_refs (0x19)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -373,7 +373,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D30 (142)
+// CHECK-NEXT:     Name: D30 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __symbols (0x1A)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -382,7 +382,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D31 (131)
+// CHECK-NEXT:     Name: D31 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __category (0x1B)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -391,7 +391,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D32 (116)
+// CHECK-NEXT:     Name: D32 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __class_vars (0x1C)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -400,7 +400,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D33 (101)
+// CHECK-NEXT:     Name: D33 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __instance_vars (0x1D)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -409,7 +409,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D34 (90)
+// CHECK-NEXT:     Name: D34 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __module_info (0x1E)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -418,7 +418,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: L35 (72)
+// CHECK-NEXT:     Name: (0)
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __cstring (0x4)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -427,7 +427,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D35 (76)
+// CHECK-NEXT:     Name: D35 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __cstring (0x4)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -436,7 +436,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: L36 (53)
+// CHECK-NEXT:     Name: (0)
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __cstring (0x4)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -445,7 +445,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D36 (57)
+// CHECK-NEXT:     Name: D36 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __cstring (0x4)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -454,7 +454,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: L37 (34)
+// CHECK-NEXT:     Name: (0)
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __cstring (0x4)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -463,7 +463,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D37 (38)
+// CHECK-NEXT:     Name: D37 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __cstring (0x4)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -472,7 +472,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: L38 (15)
+// CHECK-NEXT:     Name: (0)
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __selector_strs (0x1F)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
@@ -481,7 +481,7 @@ D38:
 // CHECK-NEXT:     Value: 0x0
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Symbol {
-// CHECK-NEXT:     Name: D38 (19)
+// CHECK-NEXT:     Name: D38 ({{.*}})
 // CHECK-NEXT:     Type: Section (0xE)
 // CHECK-NEXT:     Section: __selector_strs (0x1F)
 // CHECK-NEXT:     RefType: UndefinedNonLazy (0x0)
index a3ffae67aaec6e2f7161a8157b6cb61f4ec29020..f792ec8f1ef6d9a0554f101f64a4e8b17f2b41e1 100644 (file)
@@ -79,9 +79,9 @@ t2:
 
 # NXX: move     $2, $gp
 # NXX: lui      $gp, 0
-# NXX: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16  $tmp0
+# NXX: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16
 # NXX: addiu    $gp, $gp, 0
-# NXX: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16  $tmp0
+# NXX: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16
 # N32: addu     $gp, $gp, $25
 # N64: daddu    $gp, $gp, $25
 # NXX: nop
@@ -108,4 +108,4 @@ t3:
 
 # For .cpsetup with local labels, we need to check if $tmp0 is in the symbol
 # table:
-# NXX: .text  00000000 $tmp0
+# NXX: .text  00000000 {{$}}
index d19065e0cd70be931fa95fb0187146968695915b..d0c61bc1dc5d082c673bcfd406c2ec2f4a098438 100644 (file)
@@ -4,16 +4,16 @@
 
 // CHECK: Symbols [
 // CHECK:   Symbol {
-// CHECK:     Name: $.str
+// CHECK:     Name: (0)
 // CHECK:   }
 // CHECK:   Symbol {
-// CHECK:     Name: $.str1
+// CHECK:     Name: (0)
 // CHECK:   }
 // CHECK:   Symbol {
-// CHECK:     Name: $CPI0_0
+// CHECK:     Name: (0)
 // CHECK:   }
 // CHECK:   Symbol {
-// CHECK:     Name: $CPI0_1
+// CHECK:     Name: (0)
 // CHECK:   }
 // CHECK: ]
 
index 3380a856375f6e2f30a944d258c5a16c8547c484..d813c89231c451253da3bf076c34517932053f1e 100644 (file)
@@ -10,8 +10,8 @@
 // CHECK:   0x1C R_MIPS_GOT_LO16 ext_1
 // CHECK:   0x24 R_MIPS_CALL_HI16 printf
 // CHECK:   0x30 R_MIPS_CALL_LO16 printf
-// CHECK:   0x2C R_MIPS_GOT16 $.str
-// CHECK:   0x38 R_MIPS_LO16 $.str
+// CHECK:   0x2C R_MIPS_GOT16 -
+// CHECK:   0x38 R_MIPS_LO16 -
 // CHECK: ]
 
        .text
index 5430d1fea103f8a58d41b7be6acf5235ed697164..6cf23db34df950fb76020911f4da96097d67f25d 100644 (file)
@@ -7,8 +7,8 @@
 ! CHECK-NEXT:   0x{{[0-9,A-F]+}} R_SPARC_PC10 _GLOBAL_OFFSET_TABLE_ 0x8
 ! CHECK-NEXT:   0x{{[0-9,A-F]+}} R_SPARC_GOT22 AGlobalVar 0x0
 ! CHECK-NEXT:   0x{{[0-9,A-F]+}} R_SPARC_GOT10 AGlobalVar 0x0
-! CHECK-NEXT:   0x{{[0-9,A-F]+}} R_SPARC_GOT22 .LC0 0x0
-! CHECK-NEXT:   0x{{[0-9,A-F]+}} R_SPARC_GOT10 .LC0 0x0
+! CHECK-NEXT:   0x{{[0-9,A-F]+}} R_SPARC_GOT22 - 0x0
+! CHECK-NEXT:   0x{{[0-9,A-F]+}} R_SPARC_GOT10 - 0x0
 ! CHECK-NEXT:   0x{{[0-9,A-F]+}} R_SPARC_WPLT30 bar 0x0
 ! CHECK:      ]