<div dir="ltr">How about using od instead of hexdump? od is in POSIX, distributed as part of GNU coreutils, and exists since version 1 AT&T Unix (according to Wikipedia,) so I assume it's universally available.<div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 2, 2016 at 12:56 PM, Tom Stellard <span dir="ltr"><<a href="mailto:tom@stellard.net" target="_blank">tom@stellard.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Fri, Sep 02, 2016 at 09:09:10AM +0000, George Rimar wrote:<br>
> >> --- lld/trunk/test/ELF/oformat-bin<wbr>ary.s (added)<br>
> >> +++ lld/trunk/test/ELF/oformat-bin<wbr>ary.s Thu Aug 25 04:05:47 2016<br>
> >> @@ -0,0 +1,28 @@<br>
> >> +# REQUIRES: x86<br>
> >> +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t<br>
> >> +<br>
> >> +# RUN: ld.lld -o %t.out %t --oformat binary<br>
> >> +# RUN: hexdump -C %t.out | FileCheck %s<br>
> >> +# CHECK: 00000000 90 11 22 00 00 00 00 00<br>
> >> +# CHECK-NOT: 00000010<br>
> >> +<br>
> >> +## Check case when linkerscript is used.<br>
> >> +# RUN: echo "SECTIONS { . = 0x1000; }" > %t.script<br>
> >> +# RUN: ld.lld -o %t2.out --script %t.script %t --oformat binary<br>
> >> +# RUN: hexdump -C %t2.out | FileCheck %s<br>
> ><br>
> >Hi,<br>
> ><br>
> >'hexdump -C' should be replaced with 'llvm-objdump -s' to avoid adding a<br>
> >dependency on an external tool<br>
> ><br>
> >-Tom<br>
><br>
> Hi Tom !<br>
><br>
> --oformat binary testcase is about checking feature of raw binary ouput.<br>
> So llvm-objdump -s gives me "The file was not recognized as a valid object file" here.<br>
> Not sure if there is something elve is llvm tools that can help here ?<br>
><br>
<br>
</span>OK, I was looking at the solution for r277771.  Would it work to use a<br>
python one-liner, like:<br>
<br>
python -c 'import sys; print [hex(ord(a)) for a in sys.stdin.read()]' < %t.out<br>
<br>
-Tom<br>
<br>
> George.<br>
</blockquote></div><br></div></div>