Re: [PATCH bpf-next v3 6/8] bpftool: Add LLVM as default library for disassembling JIT-ed programs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 24, 2022 at 4:05 AM Quentin Monnet <quentin@xxxxxxxxxxxxx> wrote:
>
> 2022-10-20 10:49 UTC-0700 ~ Alexei Starovoitov
> <alexei.starovoitov@xxxxxxxxx>
> > On Thu, Oct 20, 2022 at 5:37 AM Quentin Monnet <quentin@xxxxxxxxxxxxx> wrote:
> >>
> >> +
> >> +/* This callback to set the ref_type is necessary to have the LLVM disassembler
> >> + * print PC-relative addresses instead of byte offsets for branch instruction
> >> + * targets.
> >> + */
> >> +static const char *
> >> +symbol_lookup_callback(__maybe_unused void *disasm_info,
> >> +                      __maybe_unused uint64_t ref_value,
> >> +                      uint64_t *ref_type, __maybe_unused uint64_t ref_PC,
> >> +                      __maybe_unused const char **ref_name)
> >> +{
> >> +       *ref_type = LLVMDisassembler_ReferenceType_InOut_None;
> >> +       return NULL;
> >> +}
> >
> > Could you give an example before/after for asm
> > that contains 'call foo' instructions?
> > I'm not sure that above InOut_None will not break
> > symbolization.
>
> Hi Alexei, I ran a quick test and it doesn't seem we lose any
> information. Building from:

Thanks for checking. The output looks good.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux