RFC: Is it OK to disassemble instructions twice ?

Nick Clifton nickc@redhat.com
Wed Sep 11 09:44:00 GMT 2019


Hi Alan,

> Nick, I think you had the max_reloc_offset_into_insn test around the
> wrong way.  csky-linux showed up with a bunch of fails after your
> PR24907 patch, maybe due to target bugs.  Does this look like what
> you had in mind?

Umm no, but if the csky architecture does have relocs that can be applied
starting at the middle of an instruction, then I think that the correct
fix would be to update its max_reloc_offset value.  Does a patch like this
work for you ?

diff --git a/bfd/cpu-csky.c b/bfd/cpu-csky.c
index 463dce564f..c73ee035f2 100644
--- a/bfd/cpu-csky.c
+++ b/bfd/cpu-csky.c
@@ -38,7 +38,7 @@
   bfd_default_scan,       /* String to architecture conversion.  */    \
   bfd_arch_default_fill,                                               \
   NEXT,                   /* Next in list.  */                         \
-  0 /* Maximum offset of a reloc from the start of an insn.  */                \
+  3 /* Maximum offset of a reloc from the start of an insn.  */                \
 }
 
 static const bfd_arch_info_type arch_info_struct[] =

The distance_to_rel calculation should be correct, (I hope), as that
code has not changed from the older versions of objdump.

Cheers
  Nick



More information about the Binutils mailing list