[PATCH] D60270: [llvm-objcopy] Add support for Intel HEX input/output format

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 15:25:44 PDT 2019


rupprecht added a comment.

Some insight into the differences:



================
Comment at: test/tools/llvm-objcopy/ELF/ihex-writer.test:10
+# RUN: llvm-objcopy -O ihex %t-segs %t2-segs.hex
+# RUN: cat %t2-segs.hex | FileCheck %s --check-prefix=SEGMENTS
+
----------------
It looks like the addresses in this file don't match up, but I don't have a specific suggestion yet


================
Comment at: test/tools/llvm-objcopy/ELF/ihex-writer.test:60
+# CHECK-NEXT: :03000000585960EC
+# CHECK-NEXT: :0400000300000000F9
+# CHECK-NEXT: :00000001FF
----------------
It looks like this should only be printed when the address is not zero:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=bfd/ihex.c;h=101e0a76155fc48f95312c08307739cf9c1ee5eb;hb=HEAD#l880


================
Comment at: tools/llvm-objcopy/ELF/Object.cpp:205
+  Iter = utohexstr(getChecksum(S), Iter, 2);
+  *Iter++ = '\n';
+  assert(Iter == Line.end());
----------------
It looks like ihex uses `\r\n` line endings 😦

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=bfd/ihex.c;h=101e0a76155fc48f95312c08307739cf9c1ee5eb;hb=HEAD#l752

It seems weird for me to request this, but I think we should write `\r\n`, as this seems like a strange detail that people might need when consuming these files. I don't actually have any examples of this, however.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60270/new/

https://reviews.llvm.org/D60270





More information about the llvm-commits mailing list