[PATCH] D50463: [llvm-objcopy] Add --prefix-sections option

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 10 03:28:25 PDT 2018


jhenderson added a comment.

In https://reviews.llvm.org/D50463#1194301, @jakehehrlich wrote:

> I don't think I want this option to do anything more than literally add a prefix to all section names. It isn't clear that those precise semantics are being relied on anywhere and the behavior of making relocation names and not renaming symtab etc... is a result of how bfd reconstructs the output binary without consideration for what the user initially put in which is opposite the stated goal of llvm-objcopy.


I can't think of any semantic reason why names should matter for the cases discussed, with the exception of a tiny number of sections (usually to do with debug information or similar such things), names of sections shouldn't matter (and indeed, this has been discussed on the ELF gABI mailing list as a stated goal of ELF). This option WILL break DWARF sections though, which rely on the section naming. I'm not sure if this is something we should care about though?

Also, blanket renaming sections seems like a bad thing for linking, since it will affect semantics of where sections get placed. Is there actually a use-case for it?


Repository:
  rL LLVM

https://reviews.llvm.org/D50463





More information about the llvm-commits mailing list