[PATCH] D101332: [llvm-objcopy] Keep ihex sections with same address

Ian McIntyre via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 16 09:36:04 PDT 2021


mciantyre added a comment.

Sounds great, I'll get to work on that dedicated test case. Excluding all empty sections sounds reasonable, but I'll fully assess GNU objcopy's behaviors before making a recommendation.



================
Comment at: llvm/tools/llvm-objcopy/ELF/Object.cpp:180
+namespace internal {
+bool SectionCompare::operator()(const SectionBase *Lhs,
+                                const SectionBase *Rhs) const {
----------------
evgeny777 wrote:
> With this change you start using section offset/index instead of address for IHexWriter. Why? Is this something GNU objcopy does?
I didn't consider the address- vs offset-ordering implications of this change. My goal was to share code, and I was hopeful that if it works for `Segment`, it might work here. See the discussion around James' previous remarks for ways to undo this.

I've so far treated GNU objcopy as a black box, and I'm not sure how it's generating HEX outputs.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101332



More information about the llvm-commits mailing list