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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 9 10:10:42 PST 2021


MaskRay added a comment.

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.


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