Add a test that would have found the bug in r219829.
llvm-svn: 220016
This commit is contained in:
parent
0d0c78180d
commit
0eb2cec936
|
@ -0,0 +1,31 @@
|
||||||
|
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o - | llvm-readobj -r --expand-relocs | FileCheck %s
|
||||||
|
|
||||||
|
// test that we produce one relocation against each section.
|
||||||
|
|
||||||
|
// CHECK: Relocations [
|
||||||
|
// CHECK-NEXT: Section {{.*}} {
|
||||||
|
// CHECK-NEXT: Relocation {
|
||||||
|
// CHECK-NEXT: Offset:
|
||||||
|
// CHECK-NEXT: Type:
|
||||||
|
// CHECK-NEXT: Symbol: .foo (7)
|
||||||
|
// CHECK-NEXT: Addend:
|
||||||
|
// CHECK-NEXT: }
|
||||||
|
// CHECK-NEXT: Relocation {
|
||||||
|
// CHECK-NEXT: Offset:
|
||||||
|
// CHECK-NEXT: Type:
|
||||||
|
// CHECK-NEXT: Symbol: .foo (8)
|
||||||
|
// CHECK-NEXT: Addend:
|
||||||
|
// CHECK-NEXT: }
|
||||||
|
// CHECK-NEXT: }
|
||||||
|
// CHECK-NEXT: ]
|
||||||
|
|
||||||
|
.section .foo,"aG",@progbits,v,comdat
|
||||||
|
f:
|
||||||
|
|
||||||
|
.section .foo,"a",@progbits
|
||||||
|
g:
|
||||||
|
|
||||||
|
|
||||||
|
.section .bar
|
||||||
|
.quad f
|
||||||
|
.quad g
|
|
@ -676,7 +676,8 @@ void ELFDumper<ELFT>::printRelocation(const Elf_Shdr *Sec,
|
||||||
DictScope Group(W, "Relocation");
|
DictScope Group(W, "Relocation");
|
||||||
W.printHex("Offset", Rel.r_offset);
|
W.printHex("Offset", Rel.r_offset);
|
||||||
W.printNumber("Type", RelocName, (int)Rel.getType(Obj->isMips64EL()));
|
W.printNumber("Type", RelocName, (int)Rel.getType(Obj->isMips64EL()));
|
||||||
W.printString("Symbol", SymbolName.size() > 0 ? SymbolName : "-");
|
W.printNumber("Symbol", SymbolName.size() > 0 ? SymbolName : "-",
|
||||||
|
Rel.getSymbol(Obj->isMips64EL()));
|
||||||
W.printHex("Addend", Rel.r_addend);
|
W.printHex("Addend", Rel.r_addend);
|
||||||
} else {
|
} else {
|
||||||
raw_ostream& OS = W.startLine();
|
raw_ostream& OS = W.startLine();
|
||||||
|
|
Loading…
Reference in New Issue