[llvm] r275498 - llvm-objdump: extend __mh_execute_header handling to other special syms

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 17:45:45 PDT 2016


On Thu, Jul 14, 2016 at 4:13 PM, Tim Northover via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: tnorthover
> Date: Thu Jul 14 18:13:03 2016
> New Revision: 275498
>
> URL: http://llvm.org/viewvc/llvm-project?rev=275498&view=rev
> Log:
> llvm-objdump: extend __mh_execute_header handling to other special syms
>
> We don't need to print any of the special __mh_*_header symbols when
> disassembling. Since they point at the beginning of the segment (not where
> the
> actual code is) they're pretty misleading.
>
> Should also fix lld bots.
>
> Added:
>
> llvm/trunk/test/tools/llvm-objdump/ARM/Inputs/mh_dylib_header.macho-arm
>  (with props)
>     llvm/trunk/test/tools/llvm-objdump/ARM/mh_dylib_header.test
> Modified:
>     llvm/trunk/tools/llvm-objdump/MachODump.cpp
>
> Added:
> llvm/trunk/test/tools/llvm-objdump/ARM/Inputs/mh_dylib_header.macho-arm
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/ARM/Inputs/mh_dylib_header.macho-arm?rev=275498&view=auto
>
> ==============================================================================
> Binary files
> llvm/trunk/test/tools/llvm-objdump/ARM/Inputs/mh_dylib_header.macho-arm
> (added) and
> llvm/trunk/test/tools/llvm-objdump/ARM/Inputs/mh_dylib_header.macho-arm Thu
> Jul 14 18:13:03 2016 differ
>
> Propchange:
> llvm/trunk/test/tools/llvm-objdump/ARM/Inputs/mh_dylib_header.macho-arm
>
> ------------------------------------------------------------------------------
>     svn:executable = *
>

Is yaml-to-obj not sufficiently complete yet to support this file?


> Added: llvm/trunk/test/tools/llvm-objdump/ARM/mh_dylib_header.test
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/ARM/mh_dylib_header.test?rev=275498&view=auto
>
> ==============================================================================
> --- llvm/trunk/test/tools/llvm-objdump/ARM/mh_dylib_header.test (added)
> +++ llvm/trunk/test/tools/llvm-objdump/ARM/mh_dylib_header.test Thu Jul 14
> 18:13:03 2016
> @@ -0,0 +1,7 @@
> +RUN: llvm-objdump -d -macho %p/Inputs/mh_dylib_header.macho-arm
> +
> +CHECK: _t1:
> +CHECK:     movw r0, #4133
> +
> +CHECK: _a1:
> +CHECK:     bx lr
>
> Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=275498&r1=275497&r2=275498&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
> +++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Thu Jul 14 18:13:03 2016
> @@ -6708,11 +6708,13 @@ static void DisassembleMachO(StringRef F
>          outs() << "-dis-symname: __mh_execute_header not in any
> section\n";
>          return;
>        }
> -      // When this code is trying to disassemble a symbol at a time and
> in the case
> -      // there is only the __mh_execute_header symbol left as in a
> stripped
> -      // executable, we need to deal with this by ignoring this symbol so
> the whole
> -      // section is disassembled and this symbol is then not displayed.
> -      if (SymName == "__mh_execute_header")
> +      // When this code is trying to disassemble a symbol at a time and
> in the
> +      // case there is only the __mh_execute_header symbol left as in a
> stripped
> +      // executable, we need to deal with this by ignoring this symbol so
> the
> +      // whole section is disassembled and this symbol is then not
> displayed.
> +      if (SymName == "__mh_execute_header" || SymName ==
> "__mh_dylib_header" ||
> +          SymName == "__mh_bundle_header" || SymName ==
> "__mh_object_header" ||
> +          SymName == "__mh_preload_header" || SymName ==
> "__mh_dylinker_header")
>          continue;
>
>        // If we are only disassembling one symbol see if this is that
> symbol.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>



-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160714/3e6d0b5c/attachment.html>


More information about the llvm-commits mailing list