[PATCH v2] backends,bpf: add proper relocation support

Yonghong Song yhs@fb.com
Thu Jun 21 20:24:00 GMT 2018



On 6/21/18 11:58 AM, Mark Wielaard wrote:
> On Wed, Jun 20, 2018 at 07:18:22AM -0700, Yonghong Song wrote:
>> On 6/20/18 4:41 AM, Mark Wielaard wrote:
>>> The patch looks perfect. And the new testcase is good. I used the
>>> testfile to quickly test eu-readelf --debug-dump also got the
>>> relocations right, and it did of course.
>>>
>>> Just waiting for the glibc elf.h update/sync and then I'll push this to
>>> master.
>>
>> This looks perfect. Thanks!
> 
> Pushed both. Thanks for the patch and testcase.

Thanks for the below tip!
Don't know you release schedule, but could you cut a release
soon so this can be picked up by dist/pahole?

Yonghong

> 
> BTW. The following now also just works in case you have tools that
> cannot handle the BPF relocations, but can handle separate .debug
> files:
> 
> eu-strip --reloc-debug-sections -f testfile-bpf-reloc.o.debug \
> 	testfile-bpf-reloc.o
> 
> That puts the debuginfo with all (simple) relocations resolved
> into the .debug file.
> 
>    --reloc-debug-sections Resolve all trivial relocations between debug
>                           sections if the removed sections are placed in
>                           a debug file (only relevant for ET_REL files,
>                           operation is not reversable, needs -f)
> 
> This is used by some distros for the kernel .ko modules (which are
> also ET_REL files) to safe space. But also might be applicable to
> these BPF elf files in case they are packaged.
> 
> Cheers,
> 
> Mark
> 



More information about the Elfutils-devel mailing list