This is another attempt at D59351 which attempted to add --update-section, but with some heuristics for adjusting segment/section offsets/sizes in the event the data copied into the section is larger than the original size of the section. We are opting to not support this case. GNU's objcopy was able to do this because the linker and objcopy are tightly coupled enough that segment reformatting was simpler. This is not the case with llvm-objcopy and lld where they like to be separated.
This will attempt to copy data into the section without changing any other properties of the parent segment (if the section is part of one).
Nit: Newer tests in the llvm-binutils use ## for comments, to help them stand out from RUN and CHECK lines.
Should we also have a test a case without a segment?