Re: Question about elf symbol's file offset

2025-03-30 Thread Henning Meyer
The stripped redpanda binary you link to is systematically off by 2 in its dynamic symbol table: some data symbols point to section 7 (.rela.dyn), .rodata is 9 function symbols point to section 13 (.frame_ehdr), .text is 15 some data symbols (not TLS) point to section 20 (.tbss), .data.rel.ro is

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 (which is kernel uprobe expects) >

Re: Question about elf symbol's file offset

2025-03-19 Thread Mark Wielaard
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 (which is kernel uprobe expects) > in an elf (executable or shared object)? Could you point me to a description of what uprobe expects

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