[llvm] r225537 - Add the option, -universal-headers, used with -macho to print the Mach-O universal headers to llvm-objdump.

Kevin Enderby enderby at apple.com
Fri Jan 9 13:30:15 PST 2015


Thanks for the heads up Tim,  I looked at that but did not click on the correct link and thought it was an lld issue not a llvm-objdump issue.

I think this would be the diff that might fix it:

% svn diff MachODump.cpp 
Index: MachODump.cpp
===================================================================
--- MachODump.cpp	(revision 225537)
+++ MachODump.cpp	(working copy)
@@ -611,11 +611,11 @@
     // No architecture flags were specified so if this contains a slice that
     // matches the host architecture dump only that.
     if (!ArchAll) {
-      StringRef HostArchName = MachOObjectFile::getHostArch().getArchName();
       for (MachOUniversalBinary::object_iterator I = UB->begin_objects(),
                                                  E = UB->end_objects();
            I != E; ++I) {
-        if (HostArchName == I->getArchTypeName()) {
+        if (MachOObjectFile::getHostArch().getArchName() ==
+            I->getArchTypeName()) {
           ErrorOr<std::unique_ptr<ObjectFile>> ObjOrErr = I->getAsObjectFile();
           std::string ArchiveName;
           ArchiveName.clear();

Care to give me a “Looks good to me”?  As I’m not too sure this is correct.

If so I can commit ASAP,
Kev

> On Jan 9, 2015, at 1:10 PM, Tim Northover <t.p.northover at gmail.com> wrote:
> 
> Hi Kevin,
> 
> On 9 January 2015 at 11:22, Kevin Enderby <enderby at apple.com> wrote:
>> Add the option, -universal-headers, used with -macho to print the Mach-O universal headers to llvm-objdump.
> 
> Just in case you didn't notice, this looks like it revealed an ASAN
> failure: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/545
> 
> Cheers.
> 
> Tim.





More information about the llvm-commits mailing list