bad api design

Mike Stump mikestump@comcast.net
Mon Jan 4 22:54:00 GMT 2016


Code like this:

+  if (info->flags & INSN_HAS_RELOC)
+    /* If the instruction has a reloc associated with it, then the
+       offset field in the instruction will actually be the addend
+       for the reloc.  In such cases, we can ignore the pc when
+       computing addresses, since the addend is not currently
+       pc-relative.  */
+    pc = 0;

needs to be refactored and removed.  It is a bad interface and creates bugs for ports.  :-(

Further, code like this:

#ifdef ARCH_arm
    case bfd_arch_arm:
      info->symbol_is_valid = arm_symbol_is_valid;
      info->disassembler_needs_relocs = TRUE;
      break;
#endif

is rather opaque and the connection between the two is obscure.


More information about the Binutils mailing list