This is the second (and the last) part of IHEX support. Part 1 was in D60270
Details
Diff Detail
Event Timeline
test/tools/llvm-objcopy/ELF/ihex-reader.test | ||
---|---|---|
4 | The output format here is unspecified, so it's not clear if we should convert this to elf32-i386, elf64-x86-64, any of the (unimplemented) macho/coff outputs, etc. We should either assume the output is also ihex (what GNU objcopy appears to do) or return some kind of warning/error (also seems reasonable if we don't need to match failure-ness for that situation -- I wonder if anyone relies on that working?) I'm not sure if this problem is related to your patch though; running "llvm-objcopy -I binary -Barm foo.txt bar" also creates an object file when it shouldn't. For now, can you just put an explicit output format (probably you want -O elf64-x86-64) | |
22 | (same for all the other places, e.g. here too) | |
41–42 | You should be able to avoid intermediate files by piping directly into objcopy, e.g. | |
99 | nit: remove the indices (i.e. (35) here) since they're irrelevant to the test | |
122 | Running the same scenario through GNU objcopy, there are a couple significant differences in the generated object file starting here -- looks like GNU objcopy gets confused and splits the "0123456789@" into separate sections, so size here is 8, and the next section is size 3 to handle the spill over... it looks like llvm-objcopy is correct here, but mind reviewing that to make sure llvm-objcopy is making sense here? |
Addressed review comments
test/tools/llvm-objcopy/ELF/ihex-reader.test | ||
---|---|---|
122 | GNU objcopy always starts new section if it encounters SegmentAddr (02) or ExtendedAddr (04). There seems to be no strong reason doing so in llvm-objcopy, unless someone explicitly requests this. |
test/tools/llvm-objcopy/ELF/ihex-reader.test | ||
---|---|---|
2 | Nit: missing trailing full stop here and below at the end of comments. Also, we've started using '##' in many new LLVM tools tests to clarify the difference between comments and actual test commands, so it would be good if you changed that. | |
24 | Nit: don't mix single-dash long options with double-dash long options if you can avoid it (i.e. -section-headers -> --section-headers). Applies throughout this test. | |
193 | I'd find it much easier to read this test, if the CHECKs for each individual case appear immediately after the indivdiual test case(s) using them, i.e: # RUN: some stuff | FileCheck # CHECK: # RUN: some more stuff | FileCheck --check-prefix=CHUCK # RUN: yet more stuff | FileCheck --check-prefix=CHUCK # CHUCK: |
llvm/trunk/tools/llvm-objcopy/ELF/Object.cpp | ||
---|---|---|
1201 ↗ | (On Diff #204459) | @evgeny777 https://pvs-studio.com/en/blog/posts/cpp/0771/ is warning that the SecNo++ isn't guaranteed to be evaluated in the correct order - maybe perform the increment afterward? |
Nit: missing trailing full stop here and below at the end of comments. Also, we've started using '##' in many new LLVM tools tests to clarify the difference between comments and actual test commands, so it would be good if you changed that.