[PATCH] D106927: [WIP][ELFDumper] Refactor some of the helper functions to a header file.

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 29 10:48:10 PDT 2021


ayermolo added a comment.

Ah sorry was going to post on llvm-dev as RFC, but got pulled in to something else internally. 
My motivation as it was previously to improve user experience of none compiler people dealing with compiler errors and reduce the work of dev teams that support them.
Right now when relocation overflow occurs it's a manual process to figure out what the layout is.

1. Isolate linking command
2. add a flag to dump map file
3. run SED command. Suggested by @MaskRay in another review.
4. look through not so user friendly output.

I understand @MaskRay doesn't want additional code in LLD in upstream because it ads to maintenance. I am hoping that upstream community will at least be OK with refactor of helper functions so that downstream changes are more self contained.
The end goal is when relocation error occurs part of error message is a nice looking layout print out in same format as llvm-readelf --sections that user can take a look at and see what is going wrong, or ask dev team. Without repeating aforementioned steps every single time.

For header layout comment. When I refactored llvm-dwp in to a library David Blaikie asked me to split it to two commits. One refactor, and second moving files in under llvm/include/* llvm/lib/*. So I am following the same pattern here.
For too much implementation in the headers. I don't really have a strong opinion about it. I was hoping to get feedback from community. In the headers it can just be inlined without using LTO, but standard approach of linked library also works. Probably doesn't matter since this is not on a critical execution path.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106927



More information about the llvm-commits mailing list