[PATCH] D109400: [LLD] Add archive Name to relocaiton overflow printout

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 28 10:41:28 PDT 2021


ayermolo added a comment.

In D109400#3094126 <https://reviews.llvm.org/D109400#3094126>, @MaskRay wrote:

> Is this still needed?
>
> ---
>
> For recording all potential out-of-range relocations, you can use `--emit-relocs`. It is used by some post-link analysis tools like some tools in the Linux kernel and BOLT.
> You can extract SHT_RELA sections without the SHF_ALLOC flag from the linked output, and then analyze the R_X86_64_PC32 relocations. The output can be huge as --emit-relocs contains every input relocation. To make the output smaller, you can specify -g0 to drop debug info.
> It is still an open issue that clang -g codegen may be slightly different from -g0 codegen in some cases, but as a ballpark figure it should do its job well:)

Nope, your patch does the trick. Thanks.
Unfortunately I don't have the bandwidth to analyze all the various services that have potential to overflow. So usage model is to help services owners identify issues for themselves with improved diagnostics. 
One of the reasons I was suggesting various improvements to reporting errors. Downstream we have a self contained patch in Relocations.cpp that will print out layout when relocation overflow happens. It really speeds up doing first level root cause.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109400



More information about the llvm-commits mailing list