[PATCH] D38260: [llvm-objcopy] Add support for removing sections

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 6 02:39:46 PDT 2017


jhenderson added a comment.

In https://reviews.llvm.org/D38260#889492, @jakehehrlich wrote:

> In https://reviews.llvm.org/D38260#889160, @jhenderson wrote:
>
> > By the way, not sure if you noticed my comment in https://reviews.llvm.org/D38335:
> >
> > > I'm not sure it [stripping the section header string table] should be an error anyway - it looks like GNU binutils at the very least can handle an ELF with no section header string table, but with section headers, without too much problem, although I'd expect the e_shstrndx field to be set to 0 in this case.
> >
> > Can I just confirm here that you are deliberately not allowing this behaviour? FWIW, objcopy refuses to strip the section, although it is silent about doing so.
>
>
> Sorry, yes. I heard this and want to add that ability in another change. Specifically the --strip-sections change.


Okay, that's fine with me.

In https://reviews.llvm.org/D38260#890066, @jakehehrlich wrote:

> In summary I propose the following:
>
> 1. Leave writeSectionData alone so that it writes zeros. When we implement --gap-fill that can change slightly
> 2. In --strip-sections we should only remove non-allocated sections


I agree with this as an approach.

I think we need a test to demonstrate that we have zeros instead though, to demonstrate that this is the desired behaviour. I guess it would look very similar to the kept data test, but with zeroes instead of the old data.


Repository:
  rL LLVM

https://reviews.llvm.org/D38260





More information about the llvm-commits mailing list