[PATCH] D79038: [objcopy][ELF] Handle sections not contained in PT_LOAD segments

LemonBoy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 12 13:28:06 PDT 2020


LemonBoy added a comment.

In D79038#2032024 <https://reviews.llvm.org/D79038#2032024>, @MaskRay wrote:

> In D79038#2016086 <https://reviews.llvm.org/D79038#2016086>, @LemonBoy wrote:
>
> > >   test does not make sense: .bss is not covered by a PT_LOAD.
> >
> > That's the whole point of this patch, the binary that ptomptrd me to investigate why the binary image was so big has a single `PT_LOAD` segment covering only `.text`.
> >
> > > The description is also wrong now. I may say something like:
> >
> > Sure thing, I actually forgot to update it.
>
>
> Why does your executable have a .bss not covered by a PT_LOAD? I think it is invalid but I am open to justifications.
>
> An alternative is to apply D74755 <https://reviews.llvm.org/D74755>. Last time I checked D74755 <https://reviews.llvm.org/D74755> would fix your problem as well.


There's a bit more context here <https://github.com/ziglang/zig/issues/5198>, the ELF is indeed wrong but GNU objcopy manages to extract the correct raw binary. Feel free to apply whatever patch fixes the problem and/or mark this use case as invalid, I don't have much time for this stuff right now.


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

https://reviews.llvm.org/D79038





More information about the llvm-commits mailing list