[PATCH] D71035: [llvm-objcopy][ELF] -O binary: use LMA instead of sh_offset to decide where to write section contents

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 11:46:50 PST 2019


MaskRay added a comment.

In D71035#1783958 <https://reviews.llvm.org/D71035#1783958>, @rupprecht wrote:

> In D71035#1783196 <https://reviews.llvm.org/D71035#1783196>, @jhenderson wrote:
>
> > In D71035#1783026 <https://reviews.llvm.org/D71035#1783026>, @MaskRay wrote:
> >
> > > Is it ok for me to commit if there is still no other people interested in this patch for, say, 10 hours?  😂
> > >
> > > I tested it on an internal `objcopy -I ihex -O binary` use case that motivated me to send the patch. With this patch, the section content layout is now the same.
> >
> >
> > Let's give it until after the weekend. We've been stung on a few occasions by issues with binary output, so I want to give people ample opportunity to point out anything else we've missed!
>
>
> +1 to just committing after the weekend. Since you mentiond ihex, adding Eugene who implemented the reading/writing so might have something to say about the patch, although it looks like this the ihex patches didn't touch binary output.
>
> Do you have a reduced ihex test case to add too?
>
> I'll watch out for other failures internally post-commit.


ihex is not directly related the the `-O binary` issue. It just makes it easy to craft an ELF with (sec2.sh_addr-sec1.sh_addr != sec2.sh_offset-sec1.sh_offset), which may not easy with a linker.

> Address can be specified
> 
>   // ':' + Length + Address + Type + Checksum with empty data ':LLAAAATTCC'

OK, I'll commit after the weekend.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71035





More information about the llvm-commits mailing list