On 6/18/20 3:32 PM, Fabian Wolff wrote:
Hi Nick,

thanks for reporting this; indeed, I could reproduce the error, and 
llvm-dwarfdump
doesn't produce a similar error (unsurprisingly, if the file was generated with
LLVM in the first place).

I'm hereby forwarding your report to libdwarf's upstream developer - David, 
could
you have a look at this?

Thanks!

On 6/18/20 11:44 PM, Nick Lewycky wrote:
Package: dwarfdump
Version: 20200114-1
Severity: normal

Dear Maintainer,

I have an ordinary x86-64 ELF .o file (attached) which was produced by LLVM,
but dwarfdump issues an error when asked to dump the .eh_frame:

$ dwarfdump -F function_0.o

.eh_frame

dwarfdump ERROR:  dwarf_get_fde_list: 
DW_DLE_RELOC_SECTION_RELOC_TARGET_SIZE_UNKNOWN (233) so doing a relocation is 
unsafe

-


I too reproduce the error.

The relocation used was -not- one I was aware of.
This diff fixes the problem.  it should be on sourceforge
in a day or two.  I hope to create a new full release
this month --- there is significant new DWARF5 support
in the next libdwarf/dwarfdump release.

diff --git a/libdwarf/dwarf_elf_rel_detector.c
b/libdwarf/dwarf_elf_rel_detector.c
index 747bc93..5d46d57 100644
--- a/libdwarf/dwarf_elf_rel_detector.c
+++ b/libdwarf/dwarf_elf_rel_detector.c
@@ -339,6 +339,9 @@ _dwarf_is_64bit_abs_reloc(unsigned int type,
unsigned machine)
 #if defined (R_X86_64_64)
             | (type == R_X86_64_64)
 #endif
+#if defined (R_X86_64_PC64)
+            | (type == R_X86_64_PC64)
+#endif
 #if defined (R_X86_64_DTPOFF32)
             | (type == R_X86_64_DTPOFF64)
 #endif


Thanks for the report.
I've added the little object file
to the regression test base.

Regards,
David Anderson

Reply via email to