1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

Make all temporary symbols unnamed.

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.

llvm-svn: 240130
This commit is contained in:
Rafael Espindola 2015-06-19 12:16:55 +00:00
parent 56f89f8882
commit 41c3ae17be
25 changed files with 125 additions and 130 deletions

View 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).

View 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);
}

View 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;
}

View 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;

View 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: ]

View 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: ]

View 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: ]

View File

@ -28,9 +28,24 @@
// 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

View 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:

View 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{{[^ ]+}}

View 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)

4
test/MC/ELF/undef-temp.s Normal file
View File

@ -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

View 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

View File

@ -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: }

View 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: ]

View 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

View File

@ -11,28 +11,28 @@
// 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: ]

View 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: ]

View 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: ]

View 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

View 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)

View 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 {{$}}

View 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: ]

View 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

View 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: ]