[PATCH] D132755: [DWARFLinker][NFC] Set the target DWARF version explicitly.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 13:14:58 PDT 2022


avl added a comment.

In D132755#3778058 <https://reviews.llvm.org/D132755#3778058>, @dblaikie wrote:

> What's the motivation for this, exactly?

The main motivation is to have the possibility to set conversion options explicitly. f.e. currently, Target dwarf version is detected by DWARFLinker internally, type of accelerator table is also detected internally. The caller of DWARFLinker does not know the state of these options. So it is hard to implement handling depending on these implicit options. f.e. If the caller would like to set "Apple" accelerator table for DWARFv4 and "DebugNames" for DWARFv5 - it could not be done as the caller does not know the target version. It is also not good to put that handling(setting type of accelerator table based on DWARF version) inside DWARFLinker as different callers of DWARFLinker may have different requirements. So the main motivation for that change is to set options explicitly, to have a possibility to implement different behaviors in different callers.

> It seems weird to use this tool as a way to upgrade DWARF (& sort of weird to upgrade DWARF after-the-fact anyway, why not generate the desired DWARF in the first place?)

It looks to me, that feature of converting to different DWARF versions might be good. We can have a backup of binaries compiled with DWARF4. It might be useful to convert them into the DWARF5 without recompiling. That feature is not supported by the current DWARFLinker, but it might be useful. This interface change makes it possible to implement that behavior in the future. Though it is not the main motivation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132755



More information about the llvm-commits mailing list