For bare-metal targets, lldb was missing a command like 'load' in gdb which can be used to create executable image on the target. This was discussed in
This diff adds an option to "target module load" command to provide that functionality. Instead of delegating the responsibility of writing bits to memory to Module or Objfile as was discussed in the thread above, it seemed simple to do it right in the command. Otherwise it looks straight forward. I have added a little code so that this option can be used with specifying the file so that it is easy to alias this long command to something simple. I was not sure what should be the name of that option. So I am open to suggestion.
Tested with qemu and STM32L476 board and works ok. Although it needs a few more changes else where in lldb to make them work. Those changes will come in separate commits.