Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libdrgn: Always fall back to libdwfl ELF relocation
Simply doing "drgn" segmentation-faults on my machine: (gdb) bt #0 apply_elf_rela_x86_64 (relocating=relocating@entry=0x7fc843650c90, r_offset=0, r_type=2, r_addend=0, sym_value=<optimized out>) at ../../libdrgn/arch_x86_64.c:498 #1 0x00007fc88cbd523b in relocate_elf_section (platform=0x7fc843650c80, shdrnum=59, sh_addrs=0x7fc808000b20, symtab_scn=<optimized out>, reloc_scn=0x17614c8, scn=<optimized out>) at ../../libdrgn/debug_info.c:761 osandov#2 relocate_elf_file (elf=<optimized out>) at ../../libdrgn/debug_info.c:865 osandov#3 drgn_debug_info_find_sections (module=<optimized out>) at ../../libdrgn/debug_info.c:883 osandov#4 drgn_debug_info_read_module (load=load@entry=0x7ffea9d70870, dindex_state=0x7ffea9d70810, head=0x163c6b0) at ../../libdrgn/debug_info.c:970 osandov#5 0x00007fc88cbd5474 in drgn_debug_info_update_index._omp_fn.1 () at ../../libdrgn/debug_info.c:1037 osandov#6 0x00007fc88cb19769 in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1 osandov#7 0x00007fc88cb21f00 in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1 osandov#8 0x00007fc88cb1f7aa in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1 osandov#9 0x00007fc88dfb7fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486 osandov#10 0x00007fc88dafe4cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Always returning NULL in libdrgn/debug_info.c:relocate_elf_file() fixes the issue. I don't know, maybe it's a bug in drgn's implementation of ELF relocation, but add this hack for now. Signed-off-by: Peilin Ye <[email protected]>
- Loading branch information