This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
bad api design
- From: Mike Stump <mikestump at comcast dot net>
- To: Binutils <binutils at sourceware dot org>
- Date: Mon, 4 Jan 2016 14:52:01 -0800
- Subject: bad api design
- Authentication-results: sourceware.org; auth=none
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.