[PATCH] D96627: [llvm-jitlink] Implement JITLoaderGDB ObjectLinkingLayer plugin for ELF x86-64

Stefan Gränitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 02:15:06 PST 2021


sgraenitz added a comment.

In D96627#2562565 <https://reviews.llvm.org/D96627#2562565>, @lhames wrote:

> we should be synthesizing / modifying the debug object in a jitlink pass installed by the plugin

Aha, plugins can install linker passes! I didn't give enough attention to this. Sounds like it could make some extra infra in the current proposal obsolete (i.e. the callback and from the plugin to the linker driver).

> 1. LinkGraphBuilders stop skipping debug info (this adds some overhead in the case where objects have debug info, but debug info is not used by the JIT. I think that's tolerable for now, we can revisit later if we want to make this optional).
> 2. JITLinkGDBLoaderPlugin installs two plugins that cooperate to synthesize and register a debug object:
>   1. A pre-allocation pass synthesizes a debug object by copying the data out of the debug sections in the graph. In the synthesized object section and symbol target addresses are initially zero. The pass then deletes the debug sections from the graph.
>   2. A post-allocation pass mutates the synthesized debug object based on the final target addresses in the graph. It then calls the runtime to register the debug info with the gdb registration API.
>
> Does that sound reasonable?

Yes, I will have a look at the API to install linker passes and see how far I come.

Could the LinkGraph even drop debug sections by default at a later point in time, i.e. after the plugin had the chance to copy them out?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96627



More information about the llvm-commits mailing list