[PATCH] D46369: [llvm-objcopy] Add --strip-symbol (-N) option

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 3 16:41:39 PDT 2018


jakehehrlich requested changes to this revision.
jakehehrlich added a comment.

I totally forgot about those isues! Yeah we don't want to leave dangling references around. I really should have caught that issue but I was thinking. I just figured I had already worked out all the issues with symbol removal when I wrote removeSectionReferences but you don't have to worry about those sections sticking around in that case where you *do* have to worry about it in the generic symbol removal case.  The behavior I'd like to see here is that the relocations referencing a remove symbol cause an error to be thrown. I'm considering what I want to happen for groups but I belive it should also cause an error if you try to remove the symbol of a group section. I couldn't find any other Symbol pointers and that is the canonical way to refer to a pointer so I believe James caught all the cases. This is going to require extending the hierarchy with a special 'removeSymbolReferences' method in SectionBase and then adding a special 'removeSymbols' function in Object...sorry this just got a lot more complicated.


Repository:
  rL LLVM

https://reviews.llvm.org/D46369





More information about the llvm-commits mailing list