windelbouwman / ppci

A compiler for ARM, X86, MSP430, xtensa and more implemented in pure Python
https://ppci.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
337 stars 36 forks source link

"objcopy" seems to mandate --segment switch ungroundly #38

Closed pfalcon closed 4 years ago

pfalcon commented 4 years ago

For starters:

python -m ppci objcopy --output-format elf hello.all.o hello
usage: __main__.py [-h] [--log log-level] [--report report-file]
                   [--html-report html-report-file]
                   [--text-report text-report-file] [--verbose] [--version]
                   --segment SEGMENT [--output-format OUTPUT_FORMAT]
                   input output
__main__.py: error: the following arguments are required: --segment/-S

(Note the cosmetical issue of __main__.py appearing in the output, that needs to be solved too.)

While making my make-based example, I wondered what the heck "flash" is https://github.com/windelbouwman/ppci-mirror/blob/master/examples/linux64/hello/build.xml#L26 . That "imagename" is what translates to --segment (that's !! on its own, and explain why I would like to stay away from ppci-build as far as possible, and think that everyone else should have a clear option to do the same - life is just to short to repeatedly solve quizzes like that on almost every step).

So, now brushing up the make-based example, I see that you can actually pass anything to --segment, in other words, for the case --output-format=elf it's just ignored. So, let's make it like that, because again, quizzes to solve on every step ;-).

pfalcon commented 4 years ago

This is addressed in 23986ea4f8e9763775b083ef8921b636c33f3892, closing.