llvm.org GIT mirror llvm / 5b003bb
llvm-readobj: fix MachO relocatoin printing a bit. There were two issues here: 1. At the very least, scattered relocations cannot use the same code to determine the corresponding symbol being referred to. For some reason we pretend there is no symbol, even when one actually exists in the symtab, so to match this behaviour getRelocationSymbol should simply return symbols_end for scattered relocations. 2. Printing "-" when we can't get a symbol (including the scattered case, but not exclusively), isn't that helpful. In both cases there *is* interesting information in that field, so we should print it. As hex will do. Small part of rdar://problem/17553104 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212332 91177308-0d34-0410-b5e6-96231b3b80d8 Tim Northover 6 years ago
7 changed file(s) with 88 addition(s) and 73 deletion(s). Raw diff Collapse all Expand all
867867 symbol_iterator
868868 MachOObjectFile::getRelocationSymbol(DataRefImpl Rel) const {
869869 MachO::any_relocation_info RE = getRelocation(Rel);
870 if (isRelocationScattered(RE))
871 return symbol_end();
872
870873 uint32_t SymbolIdx = getPlainRelocationSymbolNum(RE);
871874 bool isExtern = getPlainRelocationExternal(RE);
872875 if (!isExtern)
6161 ; DARWIN-G4-DUMP:AddressSize: 32bit
6262 ; DARWIN-G4-DUMP:Relocations [
6363 ; DARWIN-G4-DUMP: Section __text {
64 ; DARWIN-G4-DUMP: 0x34 1 2 0 PPC_RELOC_BR24 0 -
65 ; DARWIN-G4-DUMP: 0x30 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 _main
66 ; DARWIN-G4-DUMP: 0x0 0 2 n/a PPC_RELOC_PAIR 1 _main
67 ; DARWIN-G4-DUMP: 0x2C 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 _main
68 ; DARWIN-G4-DUMP: 0x60 0 2 n/a PPC_RELOC_PAIR 1 _main
64 ; DARWIN-G4-DUMP: 0x34 1 2 0 PPC_RELOC_BR24 0 0x3
65 ; DARWIN-G4-DUMP: 0x30 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 0x74
66 ; DARWIN-G4-DUMP: 0x0 0 2 n/a PPC_RELOC_PAIR 1 0x14
67 ; DARWIN-G4-DUMP: 0x2C 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 0x74
68 ; DARWIN-G4-DUMP: 0x60 0 2 n/a PPC_RELOC_PAIR 1 0x14
6969 ; DARWIN-G4-DUMP: }
7070 ; DARWIN-G4-DUMP: Section __picsymbolstub1 {
71 ; DARWIN-G4-DUMP: 0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 _main
72 ; DARWIN-G4-DUMP: 0x0 0 2 n/a PPC_RELOC_PAIR 1 _main
73 ; DARWIN-G4-DUMP: 0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 _main
74 ; DARWIN-G4-DUMP: 0x18 0 2 n/a PPC_RELOC_PAIR 1 _main
71 ; DARWIN-G4-DUMP: 0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 0x70
72 ; DARWIN-G4-DUMP: 0x0 0 2 n/a PPC_RELOC_PAIR 1 0x58
73 ; DARWIN-G4-DUMP: 0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 0x70
74 ; DARWIN-G4-DUMP: 0x18 0 2 n/a PPC_RELOC_PAIR 1 0x58
7575 ; DARWIN-G4-DUMP: }
7676 ; DARWIN-G4-DUMP: Section __la_symbol_ptr {
7777 ; DARWIN-G4-DUMP: 0x0 0 2 1 PPC_RELOC_VANILLA 0 dyld_stub_binding_helper
2222 // CHECK-NEXT: Reserved1:
2323 // CHECK-NEXT: Reserved2:
2424 // CHECK-NEXT: Relocations [
25 // CHECK-NEXT: 0x60 0 3 0 ARM64_RELOC_UNSIGNED 0 -
26 // CHECK-NEXT: 0x40 0 3 0 ARM64_RELOC_UNSIGNED 0 -
27 // CHECK-NEXT: 0x20 0 3 0 ARM64_RELOC_UNSIGNED 0 -
28 // CHECK-NEXT: 0x0 0 3 0 ARM64_RELOC_UNSIGNED 0 -
25 // CHECK-NEXT: 0x60 0 3 0 ARM64_RELOC_UNSIGNED 0 0x1
26 // CHECK-NEXT: 0x40 0 3 0 ARM64_RELOC_UNSIGNED 0 0x1
27 // CHECK-NEXT: 0x20 0 3 0 ARM64_RELOC_UNSIGNED 0 0x1
28 // CHECK-NEXT: 0x0 0 3 0 ARM64_RELOC_UNSIGNED 0 0x1
2929 // CHECK-NEXT: ]
3030 // CHECK-NEXT: SectionData (
3131 // CHECK-NEXT: 0000: 00000000 00000000 08000000 00000002
1616
1717 // OLD32: Relocations [
1818 // OLD32-NEXT: Section __eh_frame {
19 // OLD32-NEXT: 0x20 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 -
20 // OLD32-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 -
19 // OLD32-NEXT: 0x20 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 0x0
20 // OLD32-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 0x20
2121 // OLD32-NEXT: }
2222 // OLD32-NEXT: ]
2323
3333 MACHO-I386-NEXT: Section __text {
3434 MACHO-I386-NEXT: 0x18 1 2 1 GENERIC_RELOC_VANILLA 0 _SomeOtherFunction
3535 MACHO-I386-NEXT: 0x13 1 2 1 GENERIC_RELOC_VANILLA 0 _puts
36 MACHO-I386-NEXT: 0xB 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 -
37 MACHO-I386-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 -
36 MACHO-I386-NEXT: 0xB 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 0x22
37 MACHO-I386-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 0x8
3838 MACHO-I386-NEXT: }
3939 MACHO-I386-NEXT: ]
4040
4848
4949 MACHO-PPC: Relocations [
5050 MACHO-PPC-NEXT: Section __text {
51 MACHO-PPC-NEXT: 0x24 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 -
52 MACHO-PPC-NEXT: 0x0 0 2 n/a PPC_RELOC_PAIR 1 -
53 MACHO-PPC-NEXT: 0x1C 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 -
54 MACHO-PPC-NEXT: 0x58 0 2 n/a PPC_RELOC_PAIR 1 -
55 MACHO-PPC-NEXT: 0x18 1 2 0 PPC_RELOC_BR24 0 -
51 MACHO-PPC-NEXT: 0x24 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 0x64
52 MACHO-PPC-NEXT: 0x0 0 2 n/a PPC_RELOC_PAIR 1 0xC
53 MACHO-PPC-NEXT: 0x1C 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 0x64
54 MACHO-PPC-NEXT: 0x58 0 2 n/a PPC_RELOC_PAIR 1 0xC
55 MACHO-PPC-NEXT: 0x18 1 2 0 PPC_RELOC_BR24 0 0x2
5656 MACHO-PPC-NEXT: }
5757 MACHO-PPC-NEXT: Section __picsymbolstub1 {
58 MACHO-PPC-NEXT: 0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 -
59 MACHO-PPC-NEXT: 0x0 0 2 n/a PPC_RELOC_PAIR 1 -
60 MACHO-PPC-NEXT: 0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 -
61 MACHO-PPC-NEXT: 0x20 0 2 n/a PPC_RELOC_PAIR 1 -
58 MACHO-PPC-NEXT: 0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 0x68
59 MACHO-PPC-NEXT: 0x0 0 2 n/a PPC_RELOC_PAIR 1 0x48
60 MACHO-PPC-NEXT: 0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 0x68
61 MACHO-PPC-NEXT: 0x20 0 2 n/a PPC_RELOC_PAIR 1 0x48
6262 MACHO-PPC-NEXT: }
6363 MACHO-PPC-NEXT: Section __la_symbol_ptr {
6464 MACHO-PPC-NEXT: 0x0 0 2 1 PPC_RELOC_VANILLA 0 dyld_stub_binding_helper
6767
6868 MACHO-PPC64: Relocations [
6969 MACHO-PPC64-NEXT: Section __text {
70 MACHO-PPC64-NEXT: 0x24 0 2 n/a 1 -
71 MACHO-PPC64-NEXT: 0x0 0 2 n/a 1 -
72 MACHO-PPC64-NEXT: 0x1C 0 2 n/a 1 -
73 MACHO-PPC64-NEXT: 0x58 0 2 n/a 1 -
74 MACHO-PPC64-NEXT: 0x18 1 2 0 0 -
70 MACHO-PPC64-NEXT: 0x24 0 2 n/a 1 0x64
71 MACHO-PPC64-NEXT: 0x0 0 2 n/a 1 0xC
72 MACHO-PPC64-NEXT: 0x1C 0 2 n/a 1 0x64
73 MACHO-PPC64-NEXT: 0x58 0 2 n/a 1 0xC
74 MACHO-PPC64-NEXT: 0x18 1 2 0 0 0x2
7575 MACHO-PPC64-NEXT: }
7676 MACHO-PPC64-NEXT: Section __picsymbolstub1 {
77 MACHO-PPC64-NEXT: 0x14 0 2 n/a 1 -
78 MACHO-PPC64-NEXT: 0x0 0 2 n/a 1 -
79 MACHO-PPC64-NEXT: 0xC 0 2 n/a 1 -
80 MACHO-PPC64-NEXT: 0x24 0 2 n/a 1 -
77 MACHO-PPC64-NEXT: 0x14 0 2 n/a 1 0x6C
78 MACHO-PPC64-NEXT: 0x0 0 2 n/a 1 0x48
79 MACHO-PPC64-NEXT: 0xC 0 2 n/a 1 0x6C
80 MACHO-PPC64-NEXT: 0x24 0 2 n/a 1 0x48
8181 MACHO-PPC64-NEXT: }
8282 MACHO-PPC64-NEXT: Section __la_symbol_ptr {
8383 MACHO-PPC64-NEXT: 0x0 0 3 1 0 dyld_stub_binding_helper
9393 MACHO-ARM-NEXT: Length: 2
9494 MACHO-ARM-NEXT: Extern: N/A
9595 MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
96 MACHO-ARM-NEXT: Symbol: -
96 MACHO-ARM-NEXT: Symbol: 0x40
9797 MACHO-ARM-NEXT: Scattered: 1
9898 MACHO-ARM-NEXT: }
9999 MACHO-ARM-NEXT: Relocation {
102102 MACHO-ARM-NEXT: Length: 2
103103 MACHO-ARM-NEXT: Extern: N/A
104104 MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
105 MACHO-ARM-NEXT: Symbol: -
105 MACHO-ARM-NEXT: Symbol: 0x28
106106 MACHO-ARM-NEXT: Scattered: 1
107107 MACHO-ARM-NEXT: }
108108 MACHO-ARM-NEXT: Relocation {
129129 MACHO-ARM-NEXT: Length: 1
130130 MACHO-ARM-NEXT: Extern: 0
131131 MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
132 MACHO-ARM-NEXT: Symbol: -
132 MACHO-ARM-NEXT: Symbol: 0xFFFFFF
133133 MACHO-ARM-NEXT: Scattered: 0
134134 MACHO-ARM-NEXT: }
135135 MACHO-ARM-NEXT: Relocation {
147147 MACHO-ARM-NEXT: Length: 0
148148 MACHO-ARM-NEXT: Extern: 0
149149 MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
150 MACHO-ARM-NEXT: Symbol: -
150 MACHO-ARM-NEXT: Symbol: 0xFFFFFF
151151 MACHO-ARM-NEXT: Scattered: 0
152152 MACHO-ARM-NEXT: }
153153 MACHO-ARM-NEXT: Relocation {
156156 MACHO-ARM-NEXT: Length: 2
157157 MACHO-ARM-NEXT: Extern: N/A
158158 MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
159 MACHO-ARM-NEXT: Symbol: -
159 MACHO-ARM-NEXT: Symbol: 0x44
160160 MACHO-ARM-NEXT: Scattered: 1
161161 MACHO-ARM-NEXT: }
162162 MACHO-ARM-NEXT: Relocation {
165165 MACHO-ARM-NEXT: Length: 2
166166 MACHO-ARM-NEXT: Extern: N/A
167167 MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
168 MACHO-ARM-NEXT: Symbol: -
168 MACHO-ARM-NEXT: Symbol: 0x4
169169 MACHO-ARM-NEXT: Scattered: 1
170170 MACHO-ARM-NEXT: }
171171 MACHO-ARM-NEXT: }
182182 MACHO-I386-NEXT: Relocations [
183183 MACHO-I386-NEXT: 0x18 1 2 1 GENERIC_RELOC_VANILLA 0 _SomeOtherFunction
184184 MACHO-I386-NEXT: 0x13 1 2 1 GENERIC_RELOC_VANILLA 0 _puts
185 MACHO-I386-NEXT: 0xB 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 -
186 MACHO-I386-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 -
185 MACHO-I386-NEXT: 0xB 0 2 n/a GENERIC_RELOC_LOCAL_SECTDIFF 1 0x22
186 MACHO-I386-NEXT: 0x0 0 2 n/a GENERIC_RELOC_PAIR 1 0x8
187187 MACHO-I386-NEXT: ]
188188 MACHO-I386-NEXT: Symbols [
189189 MACHO-I386-NEXT: Symbol {
298298 MACHO-PPC-NEXT: Reserved1: 0x0
299299 MACHO-PPC-NEXT: Reserved2: 0x0
300300 MACHO-PPC-NEXT: Relocations [
301 MACHO-PPC-NEXT: 0x24 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 -
302 MACHO-PPC-NEXT: 0x0 0 2 n/a PPC_RELOC_PAIR 1 -
303 MACHO-PPC-NEXT: 0x1C 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 -
304 MACHO-PPC-NEXT: 0x58 0 2 n/a PPC_RELOC_PAIR 1 -
305 MACHO-PPC-NEXT: 0x18 1 2 0 PPC_RELOC_BR24 0 -
301 MACHO-PPC-NEXT: 0x24 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 0x64
302 MACHO-PPC-NEXT: 0x0 0 2 n/a PPC_RELOC_PAIR 1 0xC
303 MACHO-PPC-NEXT: 0x1C 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 0x64
304 MACHO-PPC-NEXT: 0x58 0 2 n/a PPC_RELOC_PAIR 1 0xC
305 MACHO-PPC-NEXT: 0x18 1 2 0 PPC_RELOC_BR24 0 0x2
306306 MACHO-PPC-NEXT: ]
307307 MACHO-PPC-NEXT: Symbols [
308308 MACHO-PPC-NEXT: Symbol {
341341 MACHO-PPC-NEXT: Reserved1: 0x0
342342 MACHO-PPC-NEXT: Reserved2: 0x20
343343 MACHO-PPC-NEXT: Relocations [
344 MACHO-PPC-NEXT: 0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 -
345 MACHO-PPC-NEXT: 0x0 0 2 n/a PPC_RELOC_PAIR 1 -
346 MACHO-PPC-NEXT: 0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 -
347 MACHO-PPC-NEXT: 0x20 0 2 n/a PPC_RELOC_PAIR 1 -
344 MACHO-PPC-NEXT: 0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 0x68
345 MACHO-PPC-NEXT: 0x0 0 2 n/a PPC_RELOC_PAIR 1 0x48
346 MACHO-PPC-NEXT: 0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 0x68
347 MACHO-PPC-NEXT: 0x20 0 2 n/a PPC_RELOC_PAIR 1 0x48
348348 MACHO-PPC-NEXT: ]
349349 MACHO-PPC-NEXT: Symbols [
350350 MACHO-PPC-NEXT: ]
455455 MACHO-PPC64-NEXT: Reserved1: 0x0
456456 MACHO-PPC64-NEXT: Reserved2: 0x0
457457 MACHO-PPC64-NEXT: Relocations [
458 MACHO-PPC64-NEXT: 0x24 0 2 n/a 1 -
459 MACHO-PPC64-NEXT: 0x0 0 2 n/a 1 -
460 MACHO-PPC64-NEXT: 0x1C 0 2 n/a 1 -
461 MACHO-PPC64-NEXT: 0x58 0 2 n/a 1 -
462 MACHO-PPC64-NEXT: 0x18 1 2 0 0 -
458 MACHO-PPC64-NEXT: 0x24 0 2 n/a 1 0x64
459 MACHO-PPC64-NEXT: 0x0 0 2 n/a 1 0xC
460 MACHO-PPC64-NEXT: 0x1C 0 2 n/a 1 0x64
461 MACHO-PPC64-NEXT: 0x58 0 2 n/a 1 0xC
462 MACHO-PPC64-NEXT: 0x18 1 2 0 0 0x2
463463 MACHO-PPC64-NEXT: ]
464464 MACHO-PPC64-NEXT: Symbols [
465465 MACHO-PPC64-NEXT: Symbol {
498498 MACHO-PPC64-NEXT: Reserved1: 0x0
499499 MACHO-PPC64-NEXT: Reserved2: 0x20
500500 MACHO-PPC64-NEXT: Relocations [
501 MACHO-PPC64-NEXT: 0x14 0 2 n/a 1 -
502 MACHO-PPC64-NEXT: 0x0 0 2 n/a 1 -
503 MACHO-PPC64-NEXT: 0xC 0 2 n/a 1 -
504 MACHO-PPC64-NEXT: 0x24 0 2 n/a 1 -
501 MACHO-PPC64-NEXT: 0x14 0 2 n/a 1 0x6C
502 MACHO-PPC64-NEXT: 0x0 0 2 n/a 1 0x48
503 MACHO-PPC64-NEXT: 0xC 0 2 n/a 1 0x6C
504 MACHO-PPC64-NEXT: 0x24 0 2 n/a 1 0x48
505505 MACHO-PPC64-NEXT: ]
506506 MACHO-PPC64-NEXT: Symbols [
507507 MACHO-PPC64-NEXT: ]
617617 MACHO-ARM-NEXT: Length: 2
618618 MACHO-ARM-NEXT: Extern: N/A
619619 MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
620 MACHO-ARM-NEXT: Symbol: -
620 MACHO-ARM-NEXT: Symbol: 0x40
621621 MACHO-ARM-NEXT: Scattered: 1
622622 MACHO-ARM-NEXT: }
623623 MACHO-ARM-NEXT: Relocation {
626626 MACHO-ARM-NEXT: Length: 2
627627 MACHO-ARM-NEXT: Extern: N/A
628628 MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
629 MACHO-ARM-NEXT: Symbol: -
629 MACHO-ARM-NEXT: Symbol: 0x28
630630 MACHO-ARM-NEXT: Scattered: 1
631631 MACHO-ARM-NEXT: }
632632 MACHO-ARM-NEXT: Relocation {
653653 MACHO-ARM-NEXT: Length: 1
654654 MACHO-ARM-NEXT: Extern: 0
655655 MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
656 MACHO-ARM-NEXT: Symbol: -
656 MACHO-ARM-NEXT: Symbol: 0xFFFFFF
657657 MACHO-ARM-NEXT: Scattered: 0
658658 MACHO-ARM-NEXT: }
659659 MACHO-ARM-NEXT: Relocation {
671671 MACHO-ARM-NEXT: Length: 0
672672 MACHO-ARM-NEXT: Extern: 0
673673 MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
674 MACHO-ARM-NEXT: Symbol: -
674 MACHO-ARM-NEXT: Symbol: 0xFFFFFF
675675 MACHO-ARM-NEXT: Scattered: 0
676676 MACHO-ARM-NEXT: }
677677 MACHO-ARM-NEXT: Relocation {
680680 MACHO-ARM-NEXT: Length: 2
681681 MACHO-ARM-NEXT: Extern: N/A
682682 MACHO-ARM-NEXT: Type: ARM_RELOC_SECTDIFF (2)
683 MACHO-ARM-NEXT: Symbol: -
683 MACHO-ARM-NEXT: Symbol: 0x44
684684 MACHO-ARM-NEXT: Scattered: 1
685685 MACHO-ARM-NEXT: }
686686 MACHO-ARM-NEXT: Relocation {
689689 MACHO-ARM-NEXT: Length: 2
690690 MACHO-ARM-NEXT: Extern: N/A
691691 MACHO-ARM-NEXT: Type: ARM_RELOC_PAIR (1)
692 MACHO-ARM-NEXT: Symbol: -
692 MACHO-ARM-NEXT: Symbol: 0x4
693693 MACHO-ARM-NEXT: Scattered: 1
694694 MACHO-ARM-NEXT: }
695695 MACHO-ARM-NEXT: ]
1515 #include "ObjDumper.h"
1616 #include "StreamWriter.h"
1717 #include "llvm/ADT/SmallString.h"
18 #include "llvm/ADT/StringExtras.h"
1819 #include "llvm/Object/MachO.h"
1920 #include "llvm/Support/Casting.h"
2021
308309 const RelocationRef &Reloc) {
309310 uint64_t Offset;
310311 SmallString<32> RelocName;
311 StringRef SymbolName;
312312 if (error(Reloc.getOffset(Offset)))
313313 return;
314314 if (error(Reloc.getTypeName(RelocName)))
315315 return;
316 symbol_iterator Symbol = Reloc.getSymbol();
317 if (Symbol != Obj->symbol_end() && error(Symbol->getName(SymbolName)))
318 return;
319316
320317 DataRefImpl DR = Reloc.getRawDataRefImpl();
321318 MachO::any_relocation_info RE = Obj->getRelocation(DR);
322319 bool IsScattered = Obj->isRelocationScattered(RE);
320 SmallString<32> SymbolNameOrOffset("0x");
321 if (IsScattered) {
322 // Scattered relocations don't really have an associated symbol
323 // for some reason, even if one exists in the symtab at the correct address.
324 SymbolNameOrOffset += utohexstr(Obj->getScatteredRelocationValue(RE));
325 } else {
326 symbol_iterator Symbol = Reloc.getSymbol();
327 if (Symbol != Obj->symbol_end()) {
328 StringRef SymbolName;
329 if (error(Symbol->getName(SymbolName)))
330 return;
331 SymbolNameOrOffset = SymbolName;
332 } else
333 SymbolNameOrOffset += utohexstr(Obj->getPlainRelocationSymbolNum(RE));
334 }
323335
324336 if (opts::ExpandRelocs) {
325337 DictScope Group(W, "Relocation");
331343 else
332344 W.printNumber("Extern", Obj->getPlainRelocationExternal(RE));
333345 W.printNumber("Type", RelocName, Obj->getAnyRelocationType(RE));
334 W.printString("Symbol", SymbolName.size() > 0 ? SymbolName : "-");
346 W.printString("Symbol", SymbolNameOrOffset);
335347 W.printNumber("Scattered", IsScattered);
336348 } else {
337349 raw_ostream& OS = W.startLine();
344356 OS << " " << Obj->getPlainRelocationExternal(RE);
345357 OS << " " << RelocName
346358 << " " << IsScattered
347 << " " << (SymbolName.size() > 0 ? SymbolName : "-")
359 << " " << SymbolNameOrOffset
348360 << "\n";
349361 }
350362 }