[PATCH] D58116: [llvm-objcopy] Improve section removal

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 14 23:51:12 PST 2019


evgeny777 added a comment.

> Can we get an explicit real use case

Well, my understanding is that when someone removes section from final image he knows what he's doing. The patch allows reducing executable size when it is possible.
Also it now calculates segment file and memory sizes based on section offsets and sizes.

FYI GNU objcopy can not only shrink, but also expand segments, recalculating section and segment addresses. See `--update-section`.
My plans were implementing GNU objcopy options and (possibly) some that I personally find useful, i.e:

- Adding/modifying symbol in dynamic symbol table (.dynsym)
- Adding/modifying dynamic table entries

This requires segment modification as well. Is there any reasons why segments shouldn't be modified by llvm-objcopy, except that it might break something?


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

https://reviews.llvm.org/D58116





More information about the llvm-commits mailing list