Re: Question about elf symbol's file offset

2025-03-30 Thread Hengqi Chen
Hi Mark, Sorry for the late reply On Wed, Mar 19, 2025 at 8:55 PM Mark Wielaard wrote: > > Hi Hengqi, > > On Tue, 2025-03-11 at 13:27 +0800, Hengqi Chen wrote: > > I want to ask you a question regarding elf internals. > > How to calculate a symbol's file offset (w

Question about elf symbol's file offset

2025-03-10 Thread Hengqi Chen
Hi Mark, I want to ask you a question regarding elf internals. How to calculate a symbol's file offset (which is kernel uprobe expects) in an elf (executable or shared object)? Some real world use case use either section header like libbpf: https://github.com/libbpf/libbpf/blob/374036c9f1cdfe2

dwarf_nextcu can't handle abbrev offset correctly ?

2022-12-01 Thread Hengqi Chen via Elfutils-devel
Hi, I am using pahole (which relies on libelf) to process an elf file ([0]): LLVM_OBJCOPY="objcopy" pahole -J --btf_gen_floats --btf_base vmlinux adl_pci9111.ko This failed with: die__process: DW_TAG_compile_unit, DW_TAG_type_unit, DW_TAG_partial_unit or DW_TAG_skeleton_unit expected

Re: dwarf_nextcu can't handle abbrev offset correctly ?

2022-12-01 Thread Hengqi Chen via Elfutils-devel
Hi Mark, On 2022/12/1 23:54, Mark Wielaard wrote: > Hi Hengqi, > > On Thu, 2022-12-01 at 23:34 +0800, Hengqi Chen via Elfutils-devel > wrote: >> I am using pahole (which relies on libelf) to process an elf file >> ([0]): >> >> LLVM_OBJCOPY="objco

[PATCH] Add support for LoongArch

2022-12-03 Thread Hengqi Chen via Elfutils-devel
This implements initial support for the LoongArch architecture. Signed-off-by: Hengqi Chen --- backends/ChangeLog | 7 backends/Makefile.am | 7 +++- backends/loongarch_init.c| 50 ++ backends/loongarch_reloc.def | 81

Re: [PATCH] Add support for LoongArch

2022-12-12 Thread Hengqi Chen via Elfutils-devel
Hi, Mark: Any comments? Thanks. With this patch, pahole is now able to convert dwarf to BTF on LoongArch machine. cheers, -- Hengqi On Sat, Dec 3, 2022 at 9:47 PM Hengqi Chen wrote: > > This implements initial support for the LoongArch architecture. > > Signed-off-by:

Re: [PATCH] backends: add checks for _GLOBAL_OFFSET_TABLE_ on loongarch

2023-04-04 Thread Hengqi Chen via Elfutils-devel
Hi, Youling On Sat, Apr 1, 2023 at 11:19 AM Youling Tang wrote: > > Add handling of _GLOBAL_OFFSET_TABLE_. > > Before applying the patch: > $ ./src/elflint --gnu-ld ./src/elflint > section [35] '.symtab': _GLOBAL_OFFSET_TABLE_ symbol value 0x68548 > does not match .got.plt section address 0x68238