[PATCH] D104186: [llvm-objcopy] Make ihex writer similar to binary writer

Ian McIntyre via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 18:27:40 PDT 2021


mciantyre added a comment.

> if a writable section were not in a PT_LOAD segment, then previously it was skipped, if there was at least one writable section that was in such a segment, whereas now it won't be skipped.

We can manually demonstrate this by adding `SHF_ALLOC` to the `.dummy` section's flags in `ihex-elf-segments.yaml`. The `.dummy` section is intentionally excluded from the segment in that test. As of this patch, when `.dummy` is `SHF_ALLOC`, we'll write the section's contents even though its not part of a segment.

GNU objcopy always emits data-containing sections in IHEX output, even if the section is not part of a segment. If meeting parity with GNU objcopy is a goal, this patch makes LLVM objcopy behave similarly. We can check GNU objcopy with the `ihex-elf-segments.yaml` output, when `.dummy` is `SHF_ALLOC`. Tested GNU objcopy 2.36.1.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104186



More information about the llvm-commits mailing list