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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 28 10:23:34 PDT 2021


MaskRay added a comment.

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:)


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