[PATCH] D94141: [WIP][LLD] Add output section printout

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 13 10:25:16 PST 2021


ayermolo added a comment.

In D94141#2491925 <https://reviews.llvm.org/D94141#2491925>, @MaskRay wrote:

> In D94141#2491909 <https://reviews.llvm.org/D94141#2491909>, @ayermolo wrote:
>
>> In D94141#2488729 <https://reviews.llvm.org/D94141#2488729>, @MaskRay wrote:
>>
>>> In D94141#2487960 <https://reviews.llvm.org/D94141#2487960>, @ayermolo wrote:
>>>
>>>> In D94141#2483728 <https://reviews.llvm.org/D94141#2483728>, @jhenderson wrote:
>>>>
>>>>> Could you give a step-by-step example of how you might use the information you want to emit? That will help us ensure that any proposals satisfy the requirements (or possibly to suggest an alternative).
>>>>
>>>> Sure. From memory, as I was doing it last year.
>>>> I was looking in to relocation R_X86_64_DTPOFF32 out of range issue in the unknown code base in an older version of llvm. I don't quite remember all the details at this point, but it It was useful to see what the layout was produced at a glance, what each section address, and size was. Similar to what llvm-readelf -sections outputs.  Specifically as it related to .tdata/.tbss. The original theory was that maybe one of them was growing too large or linker script was messing with layout. The output, redirected to file, of print-map for that build is around 2GB. The size of each section can be just searched. Figuring out how everything laid out would require a script. I thought that having lld output summary would benefit others also, so they don't have to write a script to parse out that from output of print-map.
>>>
>>> You can use `ld.lld ... -M | sed -En '/\w+ +\w+ +\w+ \S/p'`
>>>
>>> I have seen `#include "\.\./` occasionally within a top-level llvm-project directory, but I don't think cross top-level directory should be allowed.
>>
>> Thank you for sed command.
>> I tried it on output and it partially cleaned up output, there is still quite a bit of "typeinfo name for".
>> Probably command can be modified, but I think fundamentally this comes back to the same thing. Other users of lld need to know how to use sed, and if they are say on windows find alternative or write a parsing script.
>> This is an opt-in option that provides a better usage experience so that others don't need to re-invent the wheel.
>> Just a thought.
>
> We accept new features very cautiously. Adding an option has maintenance costs and recognition cost if some options have overlapping features. You can dig up the history for previous options. They need to show values to the community. For this one, I don't think it provides any additional benefit and can just confuse users as it duplicates --print-map/-M. If you want the output, add `--noinhibit-exec` and inspect the output with `readelf -S`.

Ok, thanks for feedback/explanation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94141



More information about the llvm-commits mailing list