[PATCH] D63807: [llvm-objcopy] Add --only-keep-debug for ELF

Alex Brachet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 23:48:33 PDT 2019


abrachet added a comment.

Thanks @MaskRay.

I have had some trouble completely emulating how GNU objcopy implements --only-keep-debug, but as @jakehehrlich mentioned in D63820 <https://reviews.llvm.org/D63820> on this comment <https://reviews.llvm.org/D63820#inline-571267>, it isn't imperative that this be as aggressive as GNU objcopy. Do you have thoughts on just doing the common case, just `Sec.Flags & (SHF_ALLOC | SHF_GROUP) && Sec.Type != SHT_NOTE` and not having SectionBase::clearSectionContents abort. Also I will move the sections to the start of their segments as @jhenderson described in D40523 <https://reviews.llvm.org/D40523>. Does that sound like an acceptable implementation? I fear that I am missing things that would make this a buggy implementation, which is worse than none I believe.


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

https://reviews.llvm.org/D63807





More information about the llvm-commits mailing list