[GOLD][PATCH][UPDATED] Added support for R_ARM_V4BX relocation (with interworking)

Ian Lance Taylor iant@google.com
Wed Jan 20 00:26:00 GMT 2010


"Doug Kwan (關振德)" <dougkwan@google.com> writes:

> +  template<bool big_endian>
> +  void inline
> +  do_fixed_endian_v4bx_write(unsigned char* view, section_size_type)
> +  {
> +    const Insn_template* insns = this->stub_template()->insns();
> +    elfcpp::Swap<32, big_endian>::writeval(view, insns[0].data() +
> +                                                (this->reg_ << 16));
>
> I find the indentation a bit strange.  If Ian is okay with it, it is fine.

The operator always goes at the beginning of a line.  Multi-line
expressions should be parenthesized.  I would put the newline after
the comma, and then another one before the '+' if needed.


> +    view += insns[0].size();
> +    elfcpp::Swap<32, big_endian>::writeval(view, insns[1].data() + this->reg_);
> +    view += insns[1].size();
> +    elfcpp::Swap<32, big_endian>::writeval(view, insns[2].data() + this->reg_);
> +  }
>
> Most, if not all uses of elfcpp::Swap::writeval in gold use the correct
> pointer type.  Perhaps you need to add an reinterpret_cast? Ian?

I think this is OK if it does the right thing: writeval is overloaded.

Ian



More information about the Binutils mailing list