[llvm] r240073 - Improve the --expand-relocs handling of MachO.

Rafael Espindola rafael.espindola at gmail.com
Thu Jun 18 15:38:21 PDT 2015


Author: rafael
Date: Thu Jun 18 17:38:20 2015
New Revision: 240073

URL: http://llvm.org/viewvc/llvm-project?rev=240073&view=rev
Log:
Improve the --expand-relocs handling of MachO.

In a relocation target can take 3 basic forms

* A r_value in scattered relocations.
* A symbol in external relocations.
* A section is non-external relocations.

Have the dump reflect that. With this change we go from

CHECK-NEXT:       Extern: 0
CHECK-NEXT:       Type: X86_64_RELOC_SUBTRACTOR (5)
CHECK-NEXT:       Symbol: 0x2
CHECK-NEXT:       Scattered: 0

To just

// CHECK-NEXT:       Type: X86_64_RELOC_SUBTRACTOR (5)
// CHECK-NEXT:       Section: __data (2)

Since the relocation is with a section, we print the seciton name and don't
need to say that it is not scattered or external.

Someone motivated can add further special cases for things like
ARM64_RELOC_ADDEND and ARM_RELOC_PAIR.

Modified:
    llvm/trunk/lib/Object/MachOObjectFile.cpp
    llvm/trunk/test/CodeGen/PowerPC/hello-reloc.s
    llvm/trunk/test/MC/AArch64/arm64-leaf-compact-unwind.s
    llvm/trunk/test/MC/MachO/AArch64/classrefs.s
    llvm/trunk/test/MC/MachO/AArch64/darwin-ARM64-reloc.s
    llvm/trunk/test/MC/MachO/AArch64/ld64-workaround.s
    llvm/trunk/test/MC/MachO/AArch64/mergeable.s
    llvm/trunk/test/MC/MachO/AArch64/reloc-crash.s
    llvm/trunk/test/MC/MachO/AArch64/reloc-crash2.s
    llvm/trunk/test/MC/MachO/ARM/static-movt-relocs.s
    llvm/trunk/test/MC/MachO/darwin-x86_64-diff-reloc-assign-2.s
    llvm/trunk/test/MC/MachO/darwin-x86_64-reloc.s
    llvm/trunk/test/MC/MachO/reloc.s
    llvm/trunk/test/MC/MachO/x86_64-mergeable.s
    llvm/trunk/test/tools/llvm-readobj/relocations.test
    llvm/trunk/test/tools/llvm-readobj/sections-ext.test
    llvm/trunk/tools/llvm-readobj/MachODumper.cpp

Modified: llvm/trunk/lib/Object/MachOObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOObjectFile.cpp?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/lib/Object/MachOObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/MachOObjectFile.cpp Thu Jun 18 17:38:20 2015
@@ -2012,9 +2012,11 @@ MachOObjectFile::getAnyRelocationSection
                                    const MachO::any_relocation_info &RE) const {
   if (isRelocationScattered(RE) || getPlainRelocationExternal(RE))
     return *section_end();
-  unsigned SecNum = getPlainRelocationSymbolNum(RE) - 1;
+  unsigned SecNum = getPlainRelocationSymbolNum(RE);
+  if (SecNum == MachO::R_ABS || SecNum > Sections.size())
+    return *section_end();
   DataRefImpl DRI;
-  DRI.d.a = SecNum;
+  DRI.d.a = SecNum - 1;
   return SectionRef(DRI, this);
 }
 

Modified: llvm/trunk/test/CodeGen/PowerPC/hello-reloc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/hello-reloc.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/hello-reloc.s (original)
+++ llvm/trunk/test/CodeGen/PowerPC/hello-reloc.s Thu Jun 18 17:38:20 2015
@@ -66,46 +66,36 @@ L_.str:
 ; DARWIN-G4-DUMP:      Offset: 0x34
 ; DARWIN-G4-DUMP:      PCRel: 1
 ; DARWIN-G4-DUMP:      Length: 2
-; DARWIN-G4-DUMP:      Extern: 0
 ; DARWIN-G4-DUMP:      Type: PPC_RELOC_BR24 (3)
-; DARWIN-G4-DUMP:      Symbol: 0x3
-; DARWIN-G4-DUMP:      Scattered: 0
+; DARWIN-G4-DUMP:      Section: __picsymbolstub1
 ; DARWIN-G4-DUMP:    }
 ; DARWIN-G4-DUMP:    Relocation {
 ; DARWIN-G4-DUMP:      Offset: 0x30
 ; DARWIN-G4-DUMP:      PCRel: 0
 ; DARWIN-G4-DUMP:      Length: 2
-; DARWIN-G4-DUMP:      Extern: N/A
 ; DARWIN-G4-DUMP:      Type: PPC_RELOC_LO16_SECTDIFF (11)
-; DARWIN-G4-DUMP:      Symbol: 0x74
-; DARWIN-G4-DUMP:      Scattered: 1
+; DARWIN-G4-DUMP:      Value: 0x74
 ; DARWIN-G4-DUMP:    }
 ; DARWIN-G4-DUMP:    Relocation {
 ; DARWIN-G4-DUMP:      Offset: 0x0
 ; DARWIN-G4-DUMP:      PCRel: 0
 ; DARWIN-G4-DUMP:      Length: 2
-; DARWIN-G4-DUMP:      Extern: N/A
 ; DARWIN-G4-DUMP:      Type: PPC_RELOC_PAIR (1)
-; DARWIN-G4-DUMP:      Symbol: 0x14
-; DARWIN-G4-DUMP:      Scattered: 1
+; DARWIN-G4-DUMP:      Value: 0x14
 ; DARWIN-G4-DUMP:    }
 ; DARWIN-G4-DUMP:    Relocation {
 ; DARWIN-G4-DUMP:      Offset: 0x2C
 ; DARWIN-G4-DUMP:      PCRel: 0
 ; DARWIN-G4-DUMP:      Length: 2
-; DARWIN-G4-DUMP:      Extern: N/A
 ; DARWIN-G4-DUMP:      Type: PPC_RELOC_HA16_SECTDIFF (12)
-; DARWIN-G4-DUMP:      Symbol: 0x74
-; DARWIN-G4-DUMP:      Scattered: 1
+; DARWIN-G4-DUMP:      Value: 0x74
 ; DARWIN-G4-DUMP:    }
 ; DARWIN-G4-DUMP:    Relocation {
 ; DARWIN-G4-DUMP:      Offset: 0x60
 ; DARWIN-G4-DUMP:      PCRel: 0
 ; DARWIN-G4-DUMP:      Length: 2
-; DARWIN-G4-DUMP:      Extern: N/A
 ; DARWIN-G4-DUMP:      Type: PPC_RELOC_PAIR (1)
-; DARWIN-G4-DUMP:      Symbol: 0x14
-; DARWIN-G4-DUMP:      Scattered: 1
+; DARWIN-G4-DUMP:      Value: 0x14
 ; DARWIN-G4-DUMP:    }
 ; DARWIN-G4-DUMP:  }
 ; DARWIN-G4-DUMP:  Section __picsymbolstub1 {
@@ -113,37 +103,29 @@ L_.str:
 ; DARWIN-G4-DUMP:      Offset: 0x14
 ; DARWIN-G4-DUMP:      PCRel: 0
 ; DARWIN-G4-DUMP:      Length: 2
-; DARWIN-G4-DUMP:      Extern: N/A
 ; DARWIN-G4-DUMP:      Type: PPC_RELOC_LO16_SECTDIFF (11)
-; DARWIN-G4-DUMP:      Symbol: 0x70
-; DARWIN-G4-DUMP:      Scattered: 1
+; DARWIN-G4-DUMP:      Value: 0x70
 ; DARWIN-G4-DUMP:    }
 ; DARWIN-G4-DUMP:    Relocation {
 ; DARWIN-G4-DUMP:      Offset: 0x0
 ; DARWIN-G4-DUMP:      PCRel: 0
 ; DARWIN-G4-DUMP:      Length: 2
-; DARWIN-G4-DUMP:      Extern: N/A
 ; DARWIN-G4-DUMP:      Type: PPC_RELOC_PAIR (1)
-; DARWIN-G4-DUMP:      Symbol: 0x58
-; DARWIN-G4-DUMP:      Scattered: 1
+; DARWIN-G4-DUMP:      Value: 0x58
 ; DARWIN-G4-DUMP:    }
 ; DARWIN-G4-DUMP:    Relocation {
 ; DARWIN-G4-DUMP:      Offset: 0xC
 ; DARWIN-G4-DUMP:      PCRel: 0
 ; DARWIN-G4-DUMP:      Length: 2
-; DARWIN-G4-DUMP:      Extern: N/A
 ; DARWIN-G4-DUMP:      Type: PPC_RELOC_HA16_SECTDIFF (12)
-; DARWIN-G4-DUMP:      Symbol: 0x70
-; DARWIN-G4-DUMP:      Scattered: 1
+; DARWIN-G4-DUMP:      Value: 0x70
 ; DARWIN-G4-DUMP:    }
 ; DARWIN-G4-DUMP:    Relocation {
 ; DARWIN-G4-DUMP:      Offset: 0x18
 ; DARWIN-G4-DUMP:      PCRel: 0
 ; DARWIN-G4-DUMP:      Length: 2
-; DARWIN-G4-DUMP:      Extern: N/A
 ; DARWIN-G4-DUMP:      Type: PPC_RELOC_PAIR (1)
-; DARWIN-G4-DUMP:      Symbol: 0x58
-; DARWIN-G4-DUMP:      Scattered: 1
+; DARWIN-G4-DUMP:      Value: 0x58
 ; DARWIN-G4-DUMP:    }
 ; DARWIN-G4-DUMP:  }
 ; DARWIN-G4-DUMP:  Section __la_symbol_ptr {
@@ -151,10 +133,8 @@ L_.str:
 ; DARWIN-G4-DUMP:      Offset: 0x0
 ; DARWIN-G4-DUMP:      PCRel: 0
 ; DARWIN-G4-DUMP:      Length: 2
-; DARWIN-G4-DUMP:      Extern: 1
 ; DARWIN-G4-DUMP:      Type: PPC_RELOC_VANILLA (0)
 ; DARWIN-G4-DUMP:      Symbol: dyld_stub_binding_helper
-; DARWIN-G4-DUMP:      Scattered: 0
 ; DARWIN-G4-DUMP:    }
 ; DARWIN-G4-DUMP:  }
 ; DARWIN-G4-DUMP:]

Modified: llvm/trunk/test/MC/AArch64/arm64-leaf-compact-unwind.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/arm64-leaf-compact-unwind.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/MC/AArch64/arm64-leaf-compact-unwind.s (original)
+++ llvm/trunk/test/MC/AArch64/arm64-leaf-compact-unwind.s Thu Jun 18 17:38:20 2015
@@ -27,37 +27,29 @@
 // CHECK-NEXT:       Offset: 0x60
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: 0x1
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __text (1)
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x40
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: 0x1
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __text (1)
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x20
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: 0x1
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __text (1)
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x0
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: 0x1
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __text (1)
 // CHECK-NEXT:     }
 // CHECK-NEXT:   ]
 // CHECK-NEXT:   SectionData (

Modified: llvm/trunk/test/MC/MachO/AArch64/classrefs.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/AArch64/classrefs.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/AArch64/classrefs.s (original)
+++ llvm/trunk/test/MC/MachO/AArch64/classrefs.s Thu Jun 18 17:38:20 2015
@@ -9,10 +9,8 @@
 // CHECK-NEXT:       Offset: 0x0
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: Lbar
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/MachO/AArch64/darwin-ARM64-reloc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/AArch64/darwin-ARM64-reloc.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/AArch64/darwin-ARM64-reloc.s (original)
+++ llvm/trunk/test/MC/MachO/AArch64/darwin-ARM64-reloc.s Thu Jun 18 17:38:20 2015
@@ -40,127 +40,99 @@ L_.str:
 ; CHECK-NEXT:       Offset: 0x24
 ; CHECK-NEXT:       PCRel: 1
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_PAGE21 (3)
 ; CHECK-NEXT:       Symbol: L_.str
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:    Relocation {
 ; CHECK-NEXT:       Offset: 0x20
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_GOT_LOAD_PAGEOFF12 (6)
 ; CHECK-NEXT:       Symbol: _data_ext
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x1C
 ; CHECK-NEXT:       PCRel: 1
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_GOT_LOAD_PAGE21 (5)
 ; CHECK-NEXT:       Symbol: _data_ext
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x18
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 0
 ; CHECK-NEXT:       Type: ARM64_RELOC_ADDEND (10)
-; CHECK-NEXT:       Symbol: 0x4
-; CHECK-NEXT:       Scattered: 0
+; CHECK-NEXT:       Section: - (4)
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x18
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_PAGEOFF12 (4)
 ; CHECK-NEXT:       Symbol: _data
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x14
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 0
 ; CHECK-NEXT:       Type: ARM64_RELOC_ADDEND (10)
-; CHECK-NEXT:       Symbol: 0x1
-; CHECK-NEXT:       Scattered: 0
+; CHECK-NEXT:       Section: __text
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x14
 ; CHECK-NEXT:       PCRel: 1
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_PAGE21 (3)
 ; CHECK-NEXT:       Symbol: _data
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x10
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 0
 ; CHECK-NEXT:       Type: ARM64_RELOC_ADDEND (10)
-; CHECK-NEXT:       Symbol: 0x4
-; CHECK-NEXT:       Scattered: 0
+; CHECK-NEXT:       Section: - (4)
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x10
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_PAGEOFF12 (4)
 ; CHECK-NEXT:       Symbol: _data
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0xC
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_PAGEOFF12 (4)
 ; CHECK-NEXT:       Symbol: _data
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x8
 ; CHECK-NEXT:       PCRel: 1
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_PAGE21 (3)
 ; CHECK-NEXT:       Symbol: _data
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x4
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 0
 ; CHECK-NEXT:       Type: ARM64_RELOC_ADDEND (10)
-; CHECK-NEXT:       Symbol: 0x14
-; CHECK-NEXT:       Scattered: 0
+; CHECK-NEXT:       Section: - (20)
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x4
 ; CHECK-NEXT:       PCRel: 1
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_BRANCH26 (2)
 ; CHECK-NEXT:       Symbol: _func
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x0
 ; CHECK-NEXT:       PCRel: 1
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_BRANCH26 (2)
 ; CHECK-NEXT:       Symbol: _func
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:   }
 ; CHECK-NEXT:   Section __data {
@@ -168,91 +140,71 @@ L_.str:
 ; CHECK-NEXT:       Offset: 0x2C
 ; CHECK-NEXT:       PCRel: 1
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_POINTER_TO_GOT (7)
 ; CHECK-NEXT:       Symbol: _foo
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x24
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 3
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_POINTER_TO_GOT (7)
 ; CHECK-NEXT:       Symbol: _foo
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x20
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_SUBTRACTOR (1)
 ; CHECK-NEXT:       Symbol: _bar
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x20
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 ; CHECK-NEXT:       Symbol: _foo
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x18
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 3
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_SUBTRACTOR (1)
 ; CHECK-NEXT:       Symbol: _bar
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x18
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 3
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 ; CHECK-NEXT:       Symbol: _foo
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x10
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 3
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_SUBTRACTOR (1)
 ; CHECK-NEXT:       Symbol: _bar
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x10
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 3
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 ; CHECK-NEXT:       Symbol: _foo
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x8
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 3
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 ; CHECK-NEXT:       Symbol: _foo
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:     Relocation {
 ; CHECK-NEXT:       Offset: 0x0
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 3
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 ; CHECK-NEXT:       Symbol: _foo
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:   }
 ; CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/MachO/AArch64/ld64-workaround.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/AArch64/ld64-workaround.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/AArch64/ld64-workaround.s (original)
+++ llvm/trunk/test/MC/MachO/AArch64/ld64-workaround.s Thu Jun 18 17:38:20 2015
@@ -10,37 +10,29 @@
 // CHECK-NEXT:       Offset: 0x18
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: Llit16
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x10
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: Llit8
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x8
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: Llit4
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x0
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: Lcfstring
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/MachO/AArch64/mergeable.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/AArch64/mergeable.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/AArch64/mergeable.s (original)
+++ llvm/trunk/test/MC/MachO/AArch64/mergeable.s Thu Jun 18 17:38:20 2015
@@ -25,37 +25,29 @@ L1:
 // CHECK-NEXT:       Offset: 0x18
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: L1
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x10
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: L1
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x8
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: L0
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x0
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: L0
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/MachO/AArch64/reloc-crash.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/AArch64/reloc-crash.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/AArch64/reloc-crash.s (original)
+++ llvm/trunk/test/MC/MachO/AArch64/reloc-crash.s Thu Jun 18 17:38:20 2015
@@ -9,10 +9,8 @@
 ; CHECK-NEXT:       Offset: 0x0
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 3
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_UNSIGNED (0)
 ; CHECK-NEXT:       Symbol: Lbar
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:   }
 ; CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/MachO/AArch64/reloc-crash2.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/AArch64/reloc-crash2.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/AArch64/reloc-crash2.s (original)
+++ llvm/trunk/test/MC/MachO/AArch64/reloc-crash2.s Thu Jun 18 17:38:20 2015
@@ -8,10 +8,8 @@
 ; CHECK-NEXT:       Offset: 0x0
 ; CHECK-NEXT:       PCRel: 0
 ; CHECK-NEXT:       Length: 2
-; CHECK-NEXT:       Extern: 1
 ; CHECK-NEXT:       Type: ARM64_RELOC_PAGEOFF12 (4)
 ; CHECK-NEXT:       Symbol: ltmp1
-; CHECK-NEXT:       Scattered: 0
 ; CHECK-NEXT:     }
 ; CHECK-NEXT:   }
 ; CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/MachO/ARM/static-movt-relocs.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/ARM/static-movt-relocs.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/ARM/static-movt-relocs.s (original)
+++ llvm/trunk/test/MC/MachO/ARM/static-movt-relocs.s Thu Jun 18 17:38:20 2015
@@ -12,37 +12,29 @@ foo:
 @ CHECK-NEXT:       Offset: 0x4
 @ CHECK-NEXT:       PCRel: 0
 @ CHECK-NEXT:       Length: 3
-@ CHECK-NEXT:       Extern: 1
 @ CHECK-NEXT:       Type: ARM_RELOC_HALF (8)
 @ CHECK-NEXT:       Symbol: bar
-@ CHECK-NEXT:       Scattered: 0
 @ CHECK-NEXT:     }
 @ CHECK-NEXT:     Relocation {
 @ CHECK-NEXT:       Offset: 0x10
 @ CHECK-NEXT:       PCRel: 0
 @ CHECK-NEXT:       Length: 3
-@ CHECK-NEXT:       Extern: 0
 @ CHECK-NEXT:       Type: ARM_RELOC_PAIR (1)
-@ CHECK-NEXT:       Symbol: 0xFFFFFF
-@ CHECK-NEXT:       Scattered: 0
+@ CHECK-NEXT:       Section: -
 @ CHECK-NEXT:     }
 @ CHECK-NEXT:     Relocation {
 @ CHECK-NEXT:       Offset: 0x0
 @ CHECK-NEXT:       PCRel: 0
 @ CHECK-NEXT:       Length: 2
-@ CHECK-NEXT:       Extern: 1
 @ CHECK-NEXT:       Type: ARM_RELOC_HALF (8)
 @ CHECK-NEXT:       Symbol: bar
-@ CHECK-NEXT:       Scattered: 0
 @ CHECK-NEXT:     }
 @ CHECK-NEXT:     Relocation {
 @ CHECK-NEXT:       Offset: 0x0
 @ CHECK-NEXT:       PCRel: 0
 @ CHECK-NEXT:       Length: 2
-@ CHECK-NEXT:       Extern: 0
 @ CHECK-NEXT:       Type: ARM_RELOC_PAIR (1)
-@ CHECK-NEXT:       Symbol: 0xFFFFFF
-@ CHECK-NEXT:       Scattered: 0
+@ CHECK-NEXT:       Section: -
 @ CHECK-NEXT:     }
 @ CHECK-NEXT:   }
 @ CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/MachO/darwin-x86_64-diff-reloc-assign-2.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/darwin-x86_64-diff-reloc-assign-2.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/darwin-x86_64-diff-reloc-assign-2.s (original)
+++ llvm/trunk/test/MC/MachO/darwin-x86_64-diff-reloc-assign-2.s Thu Jun 18 17:38:20 2015
@@ -14,19 +14,15 @@ L_var2:
 // CHECK-NEXT:       Offset: 0x4
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: X86_64_RELOC_SUBTRACTOR (5)
-// CHECK-NEXT:       Symbol: 0x2
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __data (2)
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x4
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: 0x2
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __data (2)
 // CHECK-NEXT:     }
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/MachO/darwin-x86_64-reloc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/darwin-x86_64-reloc.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/darwin-x86_64-reloc.s (original)
+++ llvm/trunk/test/MC/MachO/darwin-x86_64-reloc.s Thu Jun 18 17:38:20 2015
@@ -93,46 +93,36 @@ L6:
 // CHECK-NEXT:       Offset: 0x20
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: 0x4
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __literal8
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x18
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: f6
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x10
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: 0x4
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __literal8
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x8
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_GOT (4)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x4
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_GOT (4)
 // CHECK-NEXT:       Symbol: _foobar
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Section __text {
@@ -140,289 +130,225 @@ L6:
 // CHECK-NEXT:       Offset: 0xDA
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_GOT (4)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0xD3
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED (1)
-// CHECK-NEXT:       Symbol: 0x4
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __literal8
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0xCD
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED (1)
 // CHECK-NEXT:       Symbol: f6
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0xC7
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED (1)
-// CHECK-NEXT:       Symbol: 0x4
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __literal8
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0xC1
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED (1)
-// CHECK-NEXT:       Symbol: 0x1
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __data
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0xA5
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SUBTRACTOR (5)
 // CHECK-NEXT:       Symbol: _prev
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0xA5
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x9D
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SUBTRACTOR (5)
 // CHECK-NEXT:       Symbol: _prev
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x9D
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x95
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: _prev
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x8D
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: _prev
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x79
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED_4 (8)
 // CHECK-NEXT:       Symbol: _prev
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x71
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED_2 (7)
 // CHECK-NEXT:       Symbol: _prev
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x69
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED_1 (6)
 // CHECK-NEXT:       Symbol: _prev
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x63
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED (1)
 // CHECK-NEXT:       Symbol: _prev
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x5C
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED (1)
 // CHECK-NEXT:       Symbol: _prev
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x55
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SUBTRACTOR (5)
 // CHECK-NEXT:       Symbol: _bar
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x55
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x4D
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SUBTRACTOR (5)
 // CHECK-NEXT:       Symbol: _bar
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x4D
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x45
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SUBTRACTOR (5)
 // CHECK-NEXT:       Symbol: _bar
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x45
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x3D
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x35
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x2D
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED_4 (8)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x26
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED_1 (6)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x20
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED (1)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x1A
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_SIGNED (1)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x14
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_GOT (4)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0xE
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_GOT_LOAD (3)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x7
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_BRANCH (2)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x2
 // CHECK-NEXT:       PCRel: 1
 // CHECK-NEXT:       Length: 2
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_BRANCH (2)
 // CHECK-NEXT:       Symbol: _foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:   }
 // CHECK-NEXT:   Section __debug_frame {
@@ -430,19 +356,15 @@ L6:
 // CHECK-NEXT:       Offset: 0x8
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: _ext_foo
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x0
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: 0x2
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __text
 // CHECK-NEXT:     }
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]

Modified: llvm/trunk/test/MC/MachO/reloc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/reloc.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/reloc.s (original)
+++ llvm/trunk/test/MC/MachO/reloc.s Thu Jun 18 17:38:20 2015
@@ -59,19 +59,15 @@ _f1:
 // CHECK-NEXT:      Offset: 0x6
 // CHECK-NEXT:      PCRel: 1
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: 0
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
-// CHECK-NEXT:      Symbol: 0x3
-// CHECK-NEXT:      Scattered: 0
+// CHECK-NEXT:      Section: __const
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x1
 // CHECK-NEXT:      PCRel: 1
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: 0
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
-// CHECK-NEXT:      Symbol: 0x0
-// CHECK-NEXT:      Scattered: 0
+// CHECK-NEXT:      Section: - (0)
 // CHECK-NEXT:    }
 // CHECK-NEXT:  }
 // CHECK-NEXT:  Section __data {
@@ -79,100 +75,78 @@ _f1:
 // CHECK-NEXT:      Offset: 0x2F
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: 1
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
 // CHECK-NEXT:      Symbol: _f1
-// CHECK-NEXT:      Scattered: 0
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x2B
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: 1
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
 // CHECK-NEXT:      Symbol: _f1
-// CHECK-NEXT:      Scattered: 0
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x2A
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 0
-// CHECK-NEXT:      Extern: N/A
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
-// CHECK-NEXT:      Symbol: 0x1D
-// CHECK-NEXT:      Scattered: 1
+// CHECK-NEXT:      Value: 0x1D
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x28
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 1
-// CHECK-NEXT:      Extern: N/A
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
-// CHECK-NEXT:      Symbol: 0x1D
-// CHECK-NEXT:      Scattered: 1
+// CHECK-NEXT:      Value: 0x1D
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x24
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: N/A
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
-// CHECK-NEXT:      Symbol: 0x1D
-// CHECK-NEXT:      Scattered: 1
+// CHECK-NEXT:      Value: 0x1D
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x20
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: N/A
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
-// CHECK-NEXT:      Symbol: 0x1D
-// CHECK-NEXT:      Scattered: 1
+// CHECK-NEXT:      Value: 0x1D
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x14
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: N/A
 // CHECK-NEXT:      Type: GENERIC_RELOC_LOCAL_SECTDIFF (4)
-// CHECK-NEXT:      Symbol: 0x21
-// CHECK-NEXT:      Scattered: 1
+// CHECK-NEXT:      Value: 0x21
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x0
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: N/A
 // CHECK-NEXT:      Type: GENERIC_RELOC_PAIR (1)
-// CHECK-NEXT:      Symbol: 0x29
-// CHECK-NEXT:      Scattered: 1
+// CHECK-NEXT:      Value: 0x29
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x8
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: 0
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
-// CHECK-NEXT:      Symbol: 0x2
-// CHECK-NEXT:      Scattered: 0
+// CHECK-NEXT:      Section: __data
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x4
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: 1
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
 // CHECK-NEXT:      Symbol: undef
-// CHECK-NEXT:      Scattered: 0
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x0
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: 1
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
 // CHECK-NEXT:      Symbol: undef
-// CHECK-NEXT:      Scattered: 0
 // CHECK-NEXT:    }
 // CHECK-NEXT:  }
 // CHECK-NEXT:  Section __const {
@@ -180,37 +154,29 @@ _f1:
 // CHECK-NEXT:      Offset: 0x8
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: 0
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
-// CHECK-NEXT:      Symbol: 0x1
-// CHECK-NEXT:      Scattered: 0
+// CHECK-NEXT:      Section: __text
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x4
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: 0
 // CHECK-NEXT:      Type: GENERIC_RELOC_VANILLA (0)
-// CHECK-NEXT:      Symbol: 0x3
-// CHECK-NEXT:      Scattered: 0
+// CHECK-NEXT:      Section: __const
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x0
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: N/A
 // CHECK-NEXT:      Type: GENERIC_RELOC_LOCAL_SECTDIFF (4)
-// CHECK-NEXT:      Symbol: 0x1D
-// CHECK-NEXT:      Scattered: 1
+// CHECK-NEXT:      Value: 0x1D
 // CHECK-NEXT:    }
 // CHECK-NEXT:    Relocation {
 // CHECK-NEXT:      Offset: 0x0
 // CHECK-NEXT:      PCRel: 0
 // CHECK-NEXT:      Length: 2
-// CHECK-NEXT:      Extern: N/A
 // CHECK-NEXT:      Type: GENERIC_RELOC_PAIR (1)
-// CHECK-NEXT:      Symbol: 0x40
-// CHECK-NEXT:      Scattered: 1
+// CHECK-NEXT:      Value: 0x40
 // CHECK-NEXT:    }
 // CHECK-NEXT:  }
 // CHECK-NEXT:]

Modified: llvm/trunk/test/MC/MachO/x86_64-mergeable.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/x86_64-mergeable.s?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/x86_64-mergeable.s (original)
+++ llvm/trunk/test/MC/MachO/x86_64-mergeable.s Thu Jun 18 17:38:20 2015
@@ -23,37 +23,29 @@ L1:
 // CHECK-NEXT:       Offset: 0x18
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: L1
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x10
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: 0x3
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __cstring (3)
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x8
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 1
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
 // CHECK-NEXT:       Symbol: L0
-// CHECK-NEXT:       Scattered: 0
 // CHECK-NEXT:     }
 // CHECK-NEXT:     Relocation {
 // CHECK-NEXT:       Offset: 0x0
 // CHECK-NEXT:       PCRel: 0
 // CHECK-NEXT:       Length: 3
-// CHECK-NEXT:       Extern: 0
 // CHECK-NEXT:       Type: X86_64_RELOC_UNSIGNED (0)
-// CHECK-NEXT:       Symbol: 0x2
-// CHECK-NEXT:       Scattered: 0
+// CHECK-NEXT:       Section: __literal4 (2)
 // CHECK-NEXT:     }
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]

Modified: llvm/trunk/test/tools/llvm-readobj/relocations.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/relocations.test?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/relocations.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/relocations.test Thu Jun 18 17:38:20 2015
@@ -63,46 +63,36 @@ MACHO-PPC-NEXT:     Relocation {
 MACHO-PPC-NEXT:       Offset: 0x24
 MACHO-PPC-NEXT:       PCRel: 0
 MACHO-PPC-NEXT:       Length: 2
-MACHO-PPC-NEXT:       Extern: N/A
 MACHO-PPC-NEXT:       Type: PPC_RELOC_LO16_SECTDIFF (11)
-MACHO-PPC-NEXT:       Symbol: 0x64
-MACHO-PPC-NEXT:       Scattered: 1
+MACHO-PPC-NEXT:       Value: 0x64
 MACHO-PPC-NEXT:     }
 MACHO-PPC-NEXT:     Relocation {
 MACHO-PPC-NEXT:       Offset: 0x0
 MACHO-PPC-NEXT:       PCRel: 0
 MACHO-PPC-NEXT:       Length: 2
-MACHO-PPC-NEXT:       Extern: N/A
 MACHO-PPC-NEXT:       Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT:       Symbol: 0xC
-MACHO-PPC-NEXT:       Scattered: 1
+MACHO-PPC-NEXT:       Value: 0xC
 MACHO-PPC-NEXT:     }
 MACHO-PPC-NEXT:     Relocation {
 MACHO-PPC-NEXT:       Offset: 0x1C
 MACHO-PPC-NEXT:       PCRel: 0
 MACHO-PPC-NEXT:       Length: 2
-MACHO-PPC-NEXT:       Extern: N/A
 MACHO-PPC-NEXT:       Type: PPC_RELOC_HA16_SECTDIFF (12)
-MACHO-PPC-NEXT:       Symbol: 0x64
-MACHO-PPC-NEXT:       Scattered: 1
+MACHO-PPC-NEXT:       Value: 0x64
 MACHO-PPC-NEXT:     }
 MACHO-PPC-NEXT:     Relocation {
 MACHO-PPC-NEXT:       Offset: 0x58
 MACHO-PPC-NEXT:       PCRel: 0
 MACHO-PPC-NEXT:       Length: 2
-MACHO-PPC-NEXT:       Extern: N/A
 MACHO-PPC-NEXT:       Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT:       Symbol: 0xC
-MACHO-PPC-NEXT:       Scattered: 1
+MACHO-PPC-NEXT:       Value: 0xC
 MACHO-PPC-NEXT:     }
 MACHO-PPC-NEXT:     Relocation {
 MACHO-PPC-NEXT:       Offset: 0x18
 MACHO-PPC-NEXT:       PCRel: 1
 MACHO-PPC-NEXT:       Length: 2
-MACHO-PPC-NEXT:       Extern: 0
 MACHO-PPC-NEXT:       Type: PPC_RELOC_BR24 (3)
-MACHO-PPC-NEXT:       Symbol: 0x2
-MACHO-PPC-NEXT:       Scattered: 0
+MACHO-PPC-NEXT:       Section: __picsymbolstub1 (2)
 MACHO-PPC-NEXT:     }
 MACHO-PPC-NEXT:   }
 MACHO-PPC-NEXT:   Section __picsymbolstub1 {
@@ -110,37 +100,29 @@ MACHO-PPC-NEXT:     Relocation {
 MACHO-PPC-NEXT:       Offset: 0x14
 MACHO-PPC-NEXT:       PCRel: 0
 MACHO-PPC-NEXT:       Length: 2
-MACHO-PPC-NEXT:       Extern: N/A
 MACHO-PPC-NEXT:       Type: PPC_RELOC_LO16_SECTDIFF (11)
-MACHO-PPC-NEXT:       Symbol: 0x68
-MACHO-PPC-NEXT:       Scattered: 1
+MACHO-PPC-NEXT:       Value: 0x68
 MACHO-PPC-NEXT:     }
 MACHO-PPC-NEXT:     Relocation {
 MACHO-PPC-NEXT:       Offset: 0x0
 MACHO-PPC-NEXT:       PCRel: 0
 MACHO-PPC-NEXT:       Length: 2
-MACHO-PPC-NEXT:       Extern: N/A
 MACHO-PPC-NEXT:       Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT:       Symbol: 0x48
-MACHO-PPC-NEXT:       Scattered: 1
+MACHO-PPC-NEXT:       Value: 0x48
 MACHO-PPC-NEXT:     }
 MACHO-PPC-NEXT:     Relocation {
 MACHO-PPC-NEXT:       Offset: 0xC
 MACHO-PPC-NEXT:       PCRel: 0
 MACHO-PPC-NEXT:       Length: 2
-MACHO-PPC-NEXT:       Extern: N/A
 MACHO-PPC-NEXT:       Type: PPC_RELOC_HA16_SECTDIFF (12)
-MACHO-PPC-NEXT:       Symbol: 0x68
-MACHO-PPC-NEXT:       Scattered: 1
+MACHO-PPC-NEXT:       Value: 0x68
 MACHO-PPC-NEXT:     }
 MACHO-PPC-NEXT:     Relocation {
 MACHO-PPC-NEXT:       Offset: 0x20
 MACHO-PPC-NEXT:       PCRel: 0
 MACHO-PPC-NEXT:       Length: 2
-MACHO-PPC-NEXT:       Extern: N/A
 MACHO-PPC-NEXT:       Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT:       Symbol: 0x48
-MACHO-PPC-NEXT:       Scattered: 1
+MACHO-PPC-NEXT:       Value: 0x48
 MACHO-PPC-NEXT:     }
 MACHO-PPC-NEXT:   }
 MACHO-PPC-NEXT:   Section __la_symbol_ptr {
@@ -148,10 +130,8 @@ MACHO-PPC-NEXT:     Relocation {
 MACHO-PPC-NEXT:       Offset: 0x0
 MACHO-PPC-NEXT:       PCRel: 0
 MACHO-PPC-NEXT:       Length: 2
-MACHO-PPC-NEXT:       Extern: 1
 MACHO-PPC-NEXT:       Type: PPC_RELOC_VANILLA (0)
-MACHO-PPC-NEXT:       Symbol: dyld_stub_binding_helper
-MACHO-PPC-NEXT:       Scattered: 0
+MACHO-PPC-NEXT:       Symbol: dyld_stub_binding_helper (5)
 MACHO-PPC-NEXT:     }
 MACHO-PPC-NEXT:   }
 MACHO-PPC-NEXT: ]
@@ -162,46 +142,36 @@ MACHO-PPC64-NEXT:     Relocation {
 MACHO-PPC64-NEXT:       Offset: 0x24
 MACHO-PPC64-NEXT:       PCRel: 0
 MACHO-PPC64-NEXT:       Length: 2
-MACHO-PPC64-NEXT:       Extern: N/A
 MACHO-PPC64-NEXT:       Type:  (14)
-MACHO-PPC64-NEXT:       Symbol: 0x64
-MACHO-PPC64-NEXT:       Scattered: 1
+MACHO-PPC64-NEXT:       Value: 0x64
 MACHO-PPC64-NEXT:     }
 MACHO-PPC64-NEXT:     Relocation {
 MACHO-PPC64-NEXT:       Offset: 0x0
 MACHO-PPC64-NEXT:       PCRel: 0
 MACHO-PPC64-NEXT:       Length: 2
-MACHO-PPC64-NEXT:       Extern: N/A
 MACHO-PPC64-NEXT:       Type:  (1)
-MACHO-PPC64-NEXT:       Symbol: 0xC
-MACHO-PPC64-NEXT:       Scattered: 1
+MACHO-PPC64-NEXT:       Value: 0xC
 MACHO-PPC64-NEXT:     }
 MACHO-PPC64-NEXT:     Relocation {
 MACHO-PPC64-NEXT:       Offset: 0x1C
 MACHO-PPC64-NEXT:       PCRel: 0
 MACHO-PPC64-NEXT:       Length: 2
-MACHO-PPC64-NEXT:       Extern: N/A
 MACHO-PPC64-NEXT:       Type:  (12)
-MACHO-PPC64-NEXT:       Symbol: 0x64
-MACHO-PPC64-NEXT:       Scattered: 1
+MACHO-PPC64-NEXT:       Value: 0x64
 MACHO-PPC64-NEXT:     }
 MACHO-PPC64-NEXT:     Relocation {
 MACHO-PPC64-NEXT:       Offset: 0x58
 MACHO-PPC64-NEXT:       PCRel: 0
 MACHO-PPC64-NEXT:       Length: 2
-MACHO-PPC64-NEXT:       Extern: N/A
 MACHO-PPC64-NEXT:       Type:  (1)
-MACHO-PPC64-NEXT:       Symbol: 0xC
-MACHO-PPC64-NEXT:       Scattered: 1
+MACHO-PPC64-NEXT:       Value: 0xC
 MACHO-PPC64-NEXT:     }
 MACHO-PPC64-NEXT:     Relocation {
 MACHO-PPC64-NEXT:       Offset: 0x18
 MACHO-PPC64-NEXT:       PCRel: 1
 MACHO-PPC64-NEXT:       Length: 2
-MACHO-PPC64-NEXT:       Extern: 0
 MACHO-PPC64-NEXT:       Type:  (3)
-MACHO-PPC64-NEXT:       Symbol: 0x2
-MACHO-PPC64-NEXT:       Scattered: 0
+MACHO-PPC64-NEXT:       Section: __picsymbolstub1 (2)
 MACHO-PPC64-NEXT:     }
 MACHO-PPC64-NEXT:   }
 MACHO-PPC64-NEXT:   Section __picsymbolstub1 {
@@ -209,37 +179,29 @@ MACHO-PPC64-NEXT:     Relocation {
 MACHO-PPC64-NEXT:       Offset: 0x14
 MACHO-PPC64-NEXT:       PCRel: 0
 MACHO-PPC64-NEXT:       Length: 2
-MACHO-PPC64-NEXT:       Extern: N/A
 MACHO-PPC64-NEXT:       Type:  (14)
-MACHO-PPC64-NEXT:       Symbol: 0x6C
-MACHO-PPC64-NEXT:       Scattered: 1
+MACHO-PPC64-NEXT:       Value: 0x6C
 MACHO-PPC64-NEXT:     }
 MACHO-PPC64-NEXT:     Relocation {
 MACHO-PPC64-NEXT:       Offset: 0x0
 MACHO-PPC64-NEXT:       PCRel: 0
 MACHO-PPC64-NEXT:       Length: 2
-MACHO-PPC64-NEXT:       Extern: N/A
 MACHO-PPC64-NEXT:       Type:  (1)
-MACHO-PPC64-NEXT:       Symbol: 0x48
-MACHO-PPC64-NEXT:       Scattered: 1
+MACHO-PPC64-NEXT:       Value: 0x48
 MACHO-PPC64-NEXT:     }
 MACHO-PPC64-NEXT:     Relocation {
 MACHO-PPC64-NEXT:       Offset: 0xC
 MACHO-PPC64-NEXT:       PCRel: 0
 MACHO-PPC64-NEXT:       Length: 2
-MACHO-PPC64-NEXT:       Extern: N/A
 MACHO-PPC64-NEXT:       Type:  (12)
-MACHO-PPC64-NEXT:       Symbol: 0x6C
-MACHO-PPC64-NEXT:       Scattered: 1
+MACHO-PPC64-NEXT:       Value: 0x6C
 MACHO-PPC64-NEXT:     }
 MACHO-PPC64-NEXT:     Relocation {
 MACHO-PPC64-NEXT:       Offset: 0x24
 MACHO-PPC64-NEXT:       PCRel: 0
 MACHO-PPC64-NEXT:       Length: 2
-MACHO-PPC64-NEXT:       Extern: N/A
 MACHO-PPC64-NEXT:       Type:  (1)
-MACHO-PPC64-NEXT:       Symbol: 0x48
-MACHO-PPC64-NEXT:       Scattered: 1
+MACHO-PPC64-NEXT:       Value: 0x48
 MACHO-PPC64-NEXT:     }
 MACHO-PPC64-NEXT:   }
 MACHO-PPC64-NEXT:   Section __la_symbol_ptr {
@@ -247,10 +209,8 @@ MACHO-PPC64-NEXT:     Relocation {
 MACHO-PPC64-NEXT:       Offset: 0x0
 MACHO-PPC64-NEXT:       PCRel: 0
 MACHO-PPC64-NEXT:       Length: 3
-MACHO-PPC64-NEXT:       Extern: 1
 MACHO-PPC64-NEXT:       Type:  (0)
-MACHO-PPC64-NEXT:       Symbol: dyld_stub_binding_helper
-MACHO-PPC64-NEXT:       Scattered: 0
+MACHO-PPC64-NEXT:       Symbol: dyld_stub_binding_helper (5)
 MACHO-PPC64-NEXT:     }
 MACHO-PPC64-NEXT:   }
 MACHO-PPC64-NEXT: ]
@@ -262,82 +222,64 @@ MACHO-ARM-NEXT:      Relocation {
 MACHO-ARM-NEXT:        Offset: 0x38
 MACHO-ARM-NEXT:        PCRel: 0
 MACHO-ARM-NEXT:        Length: 2
-MACHO-ARM-NEXT:        Extern: N/A
 MACHO-ARM-NEXT:        Type: ARM_RELOC_SECTDIFF (2)
-MACHO-ARM-NEXT:        Symbol: 0x40
-MACHO-ARM-NEXT:        Scattered: 1
+MACHO-ARM-NEXT:        Value: 0x40
 MACHO-ARM-NEXT:      }
 MACHO-ARM-NEXT:      Relocation {
 MACHO-ARM-NEXT:        Offset: 0x0
 MACHO-ARM-NEXT:        PCRel: 0
 MACHO-ARM-NEXT:        Length: 2
-MACHO-ARM-NEXT:        Extern: N/A
 MACHO-ARM-NEXT:        Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT:        Symbol: 0x28
-MACHO-ARM-NEXT:        Scattered: 1
+MACHO-ARM-NEXT:        Value: 0x28
 MACHO-ARM-NEXT:      }
 MACHO-ARM-NEXT:      Relocation {
 MACHO-ARM-NEXT:        Offset: 0x20
 MACHO-ARM-NEXT:        PCRel: 1
 MACHO-ARM-NEXT:        Length: 2
-MACHO-ARM-NEXT:        Extern: 1
 MACHO-ARM-NEXT:        Type: ARM_RELOC_BR24 (5)
 MACHO-ARM-NEXT:        Symbol: _g
-MACHO-ARM-NEXT:        Scattered: 0
 MACHO-ARM-NEXT:      }
 MACHO-ARM-NEXT:      Relocation {
 MACHO-ARM-NEXT:        Offset: 0x1C
 MACHO-ARM-NEXT:        PCRel: 0
 MACHO-ARM-NEXT:        Length: 1
-MACHO-ARM-NEXT:        Extern: 1
 MACHO-ARM-NEXT:        Type: ARM_RELOC_HALF (8)
 MACHO-ARM-NEXT:        Symbol: _g
-MACHO-ARM-NEXT:        Scattered: 0
 MACHO-ARM-NEXT:      }
 MACHO-ARM-NEXT:      Relocation {
 MACHO-ARM-NEXT:        Offset: 0x0
 MACHO-ARM-NEXT:        PCRel: 0
 MACHO-ARM-NEXT:        Length: 1
-MACHO-ARM-NEXT:        Extern: 0
 MACHO-ARM-NEXT:        Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT:        Symbol: 0xFFFFFF
-MACHO-ARM-NEXT:        Scattered: 0
+MACHO-ARM-NEXT:        Section: -
 MACHO-ARM-NEXT:      }
 MACHO-ARM-NEXT:      Relocation {
 MACHO-ARM-NEXT:        Offset: 0x18
 MACHO-ARM-NEXT:        PCRel: 0
 MACHO-ARM-NEXT:        Length: 0
-MACHO-ARM-NEXT:        Extern: 1
 MACHO-ARM-NEXT:        Type: ARM_RELOC_HALF (8)
 MACHO-ARM-NEXT:        Symbol: _g
-MACHO-ARM-NEXT:        Scattered: 0
 MACHO-ARM-NEXT:      }
 MACHO-ARM-NEXT:      Relocation {
 MACHO-ARM-NEXT:        Offset: 0x0
 MACHO-ARM-NEXT:        PCRel: 0
 MACHO-ARM-NEXT:        Length: 0
-MACHO-ARM-NEXT:        Extern: 0
 MACHO-ARM-NEXT:        Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT:        Symbol: 0xFFFFFF
-MACHO-ARM-NEXT:        Scattered: 0
+MACHO-ARM-NEXT:        Section: -
 MACHO-ARM-NEXT:      }
 MACHO-ARM-NEXT:      Relocation {
 MACHO-ARM-NEXT:        Offset: 0xC
 MACHO-ARM-NEXT:        PCRel: 0
 MACHO-ARM-NEXT:        Length: 2
-MACHO-ARM-NEXT:        Extern: N/A
 MACHO-ARM-NEXT:        Type: ARM_RELOC_SECTDIFF (2)
-MACHO-ARM-NEXT:        Symbol: 0x44
-MACHO-ARM-NEXT:        Scattered: 1
+MACHO-ARM-NEXT:        Value: 0x44
 MACHO-ARM-NEXT:      }
 MACHO-ARM-NEXT:      Relocation {
 MACHO-ARM-NEXT:        Offset: 0x0
 MACHO-ARM-NEXT:        PCRel: 0
 MACHO-ARM-NEXT:        Length: 2
-MACHO-ARM-NEXT:        Extern: N/A
 MACHO-ARM-NEXT:        Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT:        Symbol: 0x4
-MACHO-ARM-NEXT:        Scattered: 1
+MACHO-ARM-NEXT:        Value: 0x4
 MACHO-ARM-NEXT:      }
 MACHO-ARM-NEXT:    }
 MACHO-ARM-NEXT:  ]

Modified: llvm/trunk/test/tools/llvm-readobj/sections-ext.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/sections-ext.test?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/sections-ext.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/sections-ext.test Thu Jun 18 17:38:20 2015
@@ -302,46 +302,36 @@ MACHO-PPC-NEXT:       Relocation {
 MACHO-PPC-NEXT:         Offset: 0x24
 MACHO-PPC-NEXT:         PCRel: 0
 MACHO-PPC-NEXT:         Length: 2
-MACHO-PPC-NEXT:         Extern: N/A
 MACHO-PPC-NEXT:         Type: PPC_RELOC_LO16_SECTDIFF (11)
-MACHO-PPC-NEXT:         Symbol: 0x64
-MACHO-PPC-NEXT:         Scattered: 1
+MACHO-PPC-NEXT:         Value: 0x64
 MACHO-PPC-NEXT:       }
 MACHO-PPC-NEXT:       Relocation {
 MACHO-PPC-NEXT:         Offset: 0x0
 MACHO-PPC-NEXT:         PCRel: 0
 MACHO-PPC-NEXT:         Length: 2
-MACHO-PPC-NEXT:         Extern: N/A
 MACHO-PPC-NEXT:         Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT:         Symbol: 0xC
-MACHO-PPC-NEXT:         Scattered: 1
+MACHO-PPC-NEXT:         Value: 0xC
 MACHO-PPC-NEXT:       }
 MACHO-PPC-NEXT:       Relocation {
 MACHO-PPC-NEXT:         Offset: 0x1C
 MACHO-PPC-NEXT:         PCRel: 0
 MACHO-PPC-NEXT:         Length: 2
-MACHO-PPC-NEXT:         Extern: N/A
 MACHO-PPC-NEXT:         Type: PPC_RELOC_HA16_SECTDIFF (12)
-MACHO-PPC-NEXT:         Symbol: 0x64
-MACHO-PPC-NEXT:         Scattered: 1
+MACHO-PPC-NEXT:         Value: 0x64
 MACHO-PPC-NEXT:       }
 MACHO-PPC-NEXT:       Relocation {
 MACHO-PPC-NEXT:         Offset: 0x58
 MACHO-PPC-NEXT:         PCRel: 0
 MACHO-PPC-NEXT:         Length: 2
-MACHO-PPC-NEXT:         Extern: N/A
 MACHO-PPC-NEXT:         Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT:         Symbol: 0xC
-MACHO-PPC-NEXT:         Scattered: 1
+MACHO-PPC-NEXT:         Value: 0xC
 MACHO-PPC-NEXT:       }
 MACHO-PPC-NEXT:       Relocation {
 MACHO-PPC-NEXT:         Offset: 0x18
 MACHO-PPC-NEXT:         PCRel: 1
 MACHO-PPC-NEXT:         Length: 2
-MACHO-PPC-NEXT:         Extern: 0
 MACHO-PPC-NEXT:         Type: PPC_RELOC_BR24 (3)
-MACHO-PPC-NEXT:         Symbol: 0x2
-MACHO-PPC-NEXT:         Scattered: 0
+MACHO-PPC-NEXT:         Section: __picsymbolstub1 (2)
 MACHO-PPC-NEXT:       }
 MACHO-PPC-NEXT:     ]
 MACHO-PPC-NEXT:     Symbols [
@@ -385,37 +375,29 @@ MACHO-PPC-NEXT:       Relocation {
 MACHO-PPC-NEXT:         Offset: 0x14
 MACHO-PPC-NEXT:         PCRel: 0
 MACHO-PPC-NEXT:         Length: 2
-MACHO-PPC-NEXT:         Extern: N/A
 MACHO-PPC-NEXT:         Type: PPC_RELOC_LO16_SECTDIFF (11)
-MACHO-PPC-NEXT:         Symbol: 0x68
-MACHO-PPC-NEXT:         Scattered: 1
+MACHO-PPC-NEXT:         Value: 0x68
 MACHO-PPC-NEXT:       }
 MACHO-PPC-NEXT:       Relocation {
 MACHO-PPC-NEXT:         Offset: 0x0
 MACHO-PPC-NEXT:         PCRel: 0
 MACHO-PPC-NEXT:         Length: 2
-MACHO-PPC-NEXT:         Extern: N/A
 MACHO-PPC-NEXT:         Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT:         Symbol: 0x48
-MACHO-PPC-NEXT:         Scattered: 1
+MACHO-PPC-NEXT:         Value: 0x48
 MACHO-PPC-NEXT:       }
 MACHO-PPC-NEXT:       Relocation {
 MACHO-PPC-NEXT:         Offset: 0xC
 MACHO-PPC-NEXT:         PCRel: 0
 MACHO-PPC-NEXT:         Length: 2
-MACHO-PPC-NEXT:         Extern: N/A
 MACHO-PPC-NEXT:         Type: PPC_RELOC_HA16_SECTDIFF (12)
-MACHO-PPC-NEXT:         Symbol: 0x68
-MACHO-PPC-NEXT:         Scattered: 1
+MACHO-PPC-NEXT:         Value: 0x68
 MACHO-PPC-NEXT:       }
 MACHO-PPC-NEXT:       Relocation {
 MACHO-PPC-NEXT:         Offset: 0x20
 MACHO-PPC-NEXT:         PCRel: 0
 MACHO-PPC-NEXT:         Length: 2
-MACHO-PPC-NEXT:         Extern: N/A
 MACHO-PPC-NEXT:         Type: PPC_RELOC_PAIR (1)
-MACHO-PPC-NEXT:         Symbol: 0x48
-MACHO-PPC-NEXT:         Scattered: 1
+MACHO-PPC-NEXT:         Value: 0x48
 MACHO-PPC-NEXT:       }
 MACHO-PPC-NEXT:     ]
 MACHO-PPC-NEXT:     Symbols [
@@ -501,10 +483,8 @@ MACHO-PPC-NEXT:       Relocation {
 MACHO-PPC-NEXT:         Offset: 0x0
 MACHO-PPC-NEXT:         PCRel: 0
 MACHO-PPC-NEXT:         Length: 2
-MACHO-PPC-NEXT:         Extern: 1
 MACHO-PPC-NEXT:         Type: PPC_RELOC_VANILLA (0)
-MACHO-PPC-NEXT:         Symbol: dyld_stub_binding_helper
-MACHO-PPC-NEXT:         Scattered: 0
+MACHO-PPC-NEXT:         Symbol: dyld_stub_binding_helper (5)
 MACHO-PPC-NEXT:       }
 MACHO-PPC-NEXT:     ]
 MACHO-PPC-NEXT:     Symbols [
@@ -539,46 +519,36 @@ MACHO-PPC64-NEXT:       Relocation {
 MACHO-PPC64-NEXT:         Offset: 0x24
 MACHO-PPC64-NEXT:         PCRel: 0
 MACHO-PPC64-NEXT:         Length: 2
-MACHO-PPC64-NEXT:         Extern: N/A
 MACHO-PPC64-NEXT:         Type:  (14)
-MACHO-PPC64-NEXT:         Symbol: 0x64
-MACHO-PPC64-NEXT:         Scattered: 1
+MACHO-PPC64-NEXT:         Value: 0x64
 MACHO-PPC64-NEXT:       }
 MACHO-PPC64-NEXT:       Relocation {
 MACHO-PPC64-NEXT:         Offset: 0x0
 MACHO-PPC64-NEXT:         PCRel: 0
 MACHO-PPC64-NEXT:         Length: 2
-MACHO-PPC64-NEXT:         Extern: N/A
 MACHO-PPC64-NEXT:         Type:  (1)
-MACHO-PPC64-NEXT:         Symbol: 0xC
-MACHO-PPC64-NEXT:         Scattered: 1
+MACHO-PPC64-NEXT:         Value: 0xC
 MACHO-PPC64-NEXT:       }
 MACHO-PPC64-NEXT:       Relocation {
 MACHO-PPC64-NEXT:         Offset: 0x1C
 MACHO-PPC64-NEXT:         PCRel: 0
 MACHO-PPC64-NEXT:         Length: 2
-MACHO-PPC64-NEXT:         Extern: N/A
 MACHO-PPC64-NEXT:         Type:  (12)
-MACHO-PPC64-NEXT:         Symbol: 0x64
-MACHO-PPC64-NEXT:         Scattered: 1
+MACHO-PPC64-NEXT:         Value: 0x64
 MACHO-PPC64-NEXT:       }
 MACHO-PPC64-NEXT:       Relocation {
 MACHO-PPC64-NEXT:         Offset: 0x58
 MACHO-PPC64-NEXT:         PCRel: 0
 MACHO-PPC64-NEXT:         Length: 2
-MACHO-PPC64-NEXT:         Extern: N/A
 MACHO-PPC64-NEXT:         Type:  (1)
-MACHO-PPC64-NEXT:         Symbol: 0xC
-MACHO-PPC64-NEXT:         Scattered: 1
+MACHO-PPC64-NEXT:         Value: 0xC
 MACHO-PPC64-NEXT:       }
 MACHO-PPC64-NEXT:       Relocation {
 MACHO-PPC64-NEXT:         Offset: 0x18
 MACHO-PPC64-NEXT:         PCRel: 1
 MACHO-PPC64-NEXT:         Length: 2
-MACHO-PPC64-NEXT:         Extern: 0
 MACHO-PPC64-NEXT:         Type:  (3)
-MACHO-PPC64-NEXT:         Symbol: 0x2
-MACHO-PPC64-NEXT:         Scattered: 0
+MACHO-PPC64-NEXT:         Section: __picsymbolstub1 (2)
 MACHO-PPC64-NEXT:       }
 MACHO-PPC64-NEXT:     ]
 MACHO-PPC64-NEXT:     Symbols [
@@ -622,37 +592,29 @@ MACHO-PPC64-NEXT:       Relocation {
 MACHO-PPC64-NEXT:         Offset: 0x14
 MACHO-PPC64-NEXT:         PCRel: 0
 MACHO-PPC64-NEXT:         Length: 2
-MACHO-PPC64-NEXT:         Extern: N/A
 MACHO-PPC64-NEXT:         Type:  (14)
-MACHO-PPC64-NEXT:         Symbol: 0x6C
-MACHO-PPC64-NEXT:         Scattered: 1
+MACHO-PPC64-NEXT:         Value: 0x6C
 MACHO-PPC64-NEXT:       }
 MACHO-PPC64-NEXT:       Relocation {
 MACHO-PPC64-NEXT:         Offset: 0x0
 MACHO-PPC64-NEXT:         PCRel: 0
 MACHO-PPC64-NEXT:         Length: 2
-MACHO-PPC64-NEXT:         Extern: N/A
 MACHO-PPC64-NEXT:         Type:  (1)
-MACHO-PPC64-NEXT:         Symbol: 0x48
-MACHO-PPC64-NEXT:         Scattered: 1
+MACHO-PPC64-NEXT:         Value: 0x48
 MACHO-PPC64-NEXT:       }
 MACHO-PPC64-NEXT:       Relocation {
 MACHO-PPC64-NEXT:         Offset: 0xC
 MACHO-PPC64-NEXT:         PCRel: 0
 MACHO-PPC64-NEXT:         Length: 2
-MACHO-PPC64-NEXT:         Extern: N/A
 MACHO-PPC64-NEXT:         Type:  (12)
-MACHO-PPC64-NEXT:         Symbol: 0x6C
-MACHO-PPC64-NEXT:         Scattered: 1
+MACHO-PPC64-NEXT:         Value: 0x6C
 MACHO-PPC64-NEXT:       }
 MACHO-PPC64-NEXT:       Relocation {
 MACHO-PPC64-NEXT:         Offset: 0x24
 MACHO-PPC64-NEXT:         PCRel: 0
 MACHO-PPC64-NEXT:         Length: 2
-MACHO-PPC64-NEXT:         Extern: N/A
 MACHO-PPC64-NEXT:         Type:  (1)
-MACHO-PPC64-NEXT:         Symbol: 0x48
-MACHO-PPC64-NEXT:         Scattered: 1
+MACHO-PPC64-NEXT:         Value: 0x48
 MACHO-PPC64-NEXT:       }
 MACHO-PPC64-NEXT:     ]
 MACHO-PPC64-NEXT:     Symbols [
@@ -738,10 +700,8 @@ MACHO-PPC64-NEXT:       Relocation {
 MACHO-PPC64-NEXT:         Offset: 0x0
 MACHO-PPC64-NEXT:         PCRel: 0
 MACHO-PPC64-NEXT:         Length: 3
-MACHO-PPC64-NEXT:         Extern: 1
 MACHO-PPC64-NEXT:         Type:  (0)
-MACHO-PPC64-NEXT:         Symbol: dyld_stub_binding_helper
-MACHO-PPC64-NEXT:         Scattered: 0
+MACHO-PPC64-NEXT:         Symbol: dyld_stub_binding_helper (5)
 MACHO-PPC64-NEXT:       }
 MACHO-PPC64-NEXT:     ]
 MACHO-PPC64-NEXT:     Symbols [
@@ -775,82 +735,64 @@ MACHO-ARM-NEXT:       Relocation {
 MACHO-ARM-NEXT:         Offset: 0x38
 MACHO-ARM-NEXT:         PCRel: 0
 MACHO-ARM-NEXT:         Length: 2
-MACHO-ARM-NEXT:         Extern: N/A
 MACHO-ARM-NEXT:         Type: ARM_RELOC_SECTDIFF (2)
-MACHO-ARM-NEXT:         Symbol: 0x40
-MACHO-ARM-NEXT:         Scattered: 1
+MACHO-ARM-NEXT:         Value: 0x40
 MACHO-ARM-NEXT:       }
 MACHO-ARM-NEXT:       Relocation {
 MACHO-ARM-NEXT:         Offset: 0x0
 MACHO-ARM-NEXT:         PCRel: 0
 MACHO-ARM-NEXT:         Length: 2
-MACHO-ARM-NEXT:         Extern: N/A
 MACHO-ARM-NEXT:         Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT:         Symbol: 0x28
-MACHO-ARM-NEXT:         Scattered: 1
+MACHO-ARM-NEXT:         Value: 0x28
 MACHO-ARM-NEXT:       }
 MACHO-ARM-NEXT:       Relocation {
 MACHO-ARM-NEXT:         Offset: 0x20
 MACHO-ARM-NEXT:         PCRel: 1
 MACHO-ARM-NEXT:         Length: 2
-MACHO-ARM-NEXT:         Extern: 1
 MACHO-ARM-NEXT:         Type: ARM_RELOC_BR24 (5)
 MACHO-ARM-NEXT:         Symbol: _g
-MACHO-ARM-NEXT:         Scattered: 0
 MACHO-ARM-NEXT:       }
 MACHO-ARM-NEXT:       Relocation {
 MACHO-ARM-NEXT:         Offset: 0x1C
 MACHO-ARM-NEXT:         PCRel: 0
 MACHO-ARM-NEXT:         Length: 1
-MACHO-ARM-NEXT:         Extern: 1
 MACHO-ARM-NEXT:         Type: ARM_RELOC_HALF (8)
 MACHO-ARM-NEXT:         Symbol: _g
-MACHO-ARM-NEXT:         Scattered: 0
 MACHO-ARM-NEXT:       }
 MACHO-ARM-NEXT:       Relocation {
 MACHO-ARM-NEXT:         Offset: 0x0
 MACHO-ARM-NEXT:         PCRel: 0
 MACHO-ARM-NEXT:         Length: 1
-MACHO-ARM-NEXT:         Extern: 0
 MACHO-ARM-NEXT:         Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT:         Symbol: 0xFFFFFF
-MACHO-ARM-NEXT:         Scattered: 0
+MACHO-ARM-NEXT:         Section: -
 MACHO-ARM-NEXT:       }
 MACHO-ARM-NEXT:       Relocation {
 MACHO-ARM-NEXT:         Offset: 0x18
 MACHO-ARM-NEXT:         PCRel: 0
 MACHO-ARM-NEXT:         Length: 0
-MACHO-ARM-NEXT:         Extern: 1
 MACHO-ARM-NEXT:         Type: ARM_RELOC_HALF (8)
 MACHO-ARM-NEXT:         Symbol: _g
-MACHO-ARM-NEXT:         Scattered: 0
 MACHO-ARM-NEXT:       }
 MACHO-ARM-NEXT:       Relocation {
 MACHO-ARM-NEXT:         Offset: 0x0
 MACHO-ARM-NEXT:         PCRel: 0
 MACHO-ARM-NEXT:         Length: 0
-MACHO-ARM-NEXT:         Extern: 0
 MACHO-ARM-NEXT:         Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT:         Symbol: 0xFFFFFF
-MACHO-ARM-NEXT:         Scattered: 0
+MACHO-ARM-NEXT:         Section: -
 MACHO-ARM-NEXT:       }
 MACHO-ARM-NEXT:       Relocation {
 MACHO-ARM-NEXT:         Offset: 0xC
 MACHO-ARM-NEXT:         PCRel: 0
 MACHO-ARM-NEXT:         Length: 2
-MACHO-ARM-NEXT:         Extern: N/A
 MACHO-ARM-NEXT:         Type: ARM_RELOC_SECTDIFF (2)
-MACHO-ARM-NEXT:         Symbol: 0x44
-MACHO-ARM-NEXT:         Scattered: 1
+MACHO-ARM-NEXT:         Value: 0x44
 MACHO-ARM-NEXT:       }
 MACHO-ARM-NEXT:       Relocation {
 MACHO-ARM-NEXT:         Offset: 0x0
 MACHO-ARM-NEXT:         PCRel: 0
 MACHO-ARM-NEXT:         Length: 2
-MACHO-ARM-NEXT:         Extern: N/A
 MACHO-ARM-NEXT:         Type: ARM_RELOC_PAIR (1)
-MACHO-ARM-NEXT:         Symbol: 0x4
-MACHO-ARM-NEXT:         Scattered: 1
+MACHO-ARM-NEXT:         Value: 0x4
 MACHO-ARM-NEXT:       }
 MACHO-ARM-NEXT:     ]
 MACHO-ARM-NEXT:     Symbols [

Modified: llvm/trunk/tools/llvm-readobj/MachODumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/MachODumper.cpp?rev=240073&r1=240072&r2=240073&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/MachODumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/MachODumper.cpp Thu Jun 18 17:38:20 2015
@@ -469,35 +469,47 @@ void MachODumper::printRelocation(const
   DataRefImpl DR = Reloc.getRawDataRefImpl();
   MachO::any_relocation_info RE = Obj->getRelocation(DR);
   bool IsScattered = Obj->isRelocationScattered(RE);
-  SmallString<32> SymbolNameOrOffset("0x");
-  if (IsScattered) {
-    // Scattered relocations don't really have an associated symbol
-    // for some reason, even if one exists in the symtab at the correct address.
-    SymbolNameOrOffset += utohexstr(Obj->getScatteredRelocationValue(RE));
-  } else {
+  bool IsExtern = !IsScattered && Obj->getPlainRelocationExternal(RE);
+
+  StringRef TargetName;
+  if (IsExtern) {
     symbol_iterator Symbol = Reloc.getSymbol();
     if (Symbol != Obj->symbol_end()) {
-      StringRef SymbolName;
-      if (error(Symbol->getName(SymbolName)))
+      if (error(Symbol->getName(TargetName)))
         return;
-      SymbolNameOrOffset = SymbolName;
-    } else
-      SymbolNameOrOffset += utohexstr(Obj->getPlainRelocationSymbolNum(RE));
+    }
+  } else if (!IsScattered) {
+    section_iterator SecI = Reloc.getSection();
+    if (SecI != Obj->section_end()) {
+      if (error(SecI->getName(TargetName)))
+        return;
+    }
   }
+  if (TargetName.empty())
+    TargetName = "-";
 
   if (opts::ExpandRelocs) {
     DictScope Group(W, "Relocation");
     W.printHex("Offset", Offset);
     W.printNumber("PCRel", Obj->getAnyRelocationPCRel(RE));
     W.printNumber("Length", Obj->getAnyRelocationLength(RE));
-    if (IsScattered)
-      W.printString("Extern", StringRef("N/A"));
-    else
-      W.printNumber("Extern", Obj->getPlainRelocationExternal(RE));
     W.printNumber("Type", RelocName, Obj->getAnyRelocationType(RE));
-    W.printString("Symbol", SymbolNameOrOffset);
-    W.printNumber("Scattered", IsScattered);
+    if (IsScattered) {
+      W.printHex("Value", Obj->getScatteredRelocationValue(RE));
+    } else {
+      const char *Kind = IsExtern ? "Symbol" : "Section";
+      W.printNumber(Kind, TargetName, Obj->getPlainRelocationSymbolNum(RE));
+    }
   } else {
+    SmallString<32> SymbolNameOrOffset("0x");
+    if (IsScattered) {
+      // Scattered relocations don't really have an associated symbol for some
+      // reason, even if one exists in the symtab at the correct address.
+      SymbolNameOrOffset += utohexstr(Obj->getScatteredRelocationValue(RE));
+    } else {
+      SymbolNameOrOffset = TargetName;
+    }
+
     raw_ostream& OS = W.startLine();
     OS << W.hex(Offset)
        << " " << Obj->getAnyRelocationPCRel(RE)





More information about the llvm-commits mailing list