Currently, if you use llvm-objcopy to translate an ELF image into
'ihex' format, the input ELF file's entry point address will be
converted into x86-16 segment:offset style if it's less than 1MB, and
the same happens to addresses of data records. The separate record
types for a flat 32-bit address space are not used unless an address
is too big for the segment:offset style.
This is awkward for users consuming the file, who may find they need
to understand both formats of start address and both formats of data
address record. And it doesn't have any relevance to any of LLVM's
target architectures, since we support x86-32 but not x86-16. So users
wanting to write the simplest possible ihex consumer would prefer the
producer to emit the 32-bit record types unconditionally.
I haven't changed the existing format in this commit, on the
assumption that exactly matching the behavior of GNU objdump is a
useful property. Instead, I've added a new output-only format name
"ihex-flat" alongside the existing "ihex", and made the format changes
conditional on that.
I suggest MayUseSegmentOffset since, if I understand it correctly, you may need to use the other format even if this is true.