This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gold: addend issues in

> I asked him to handle REL and RELA together so that the "ignore addend
> when negative" logic would live in only one place and not be copied.
> If the subroutine handles only REL, then that logic should be outside
> it.  The existing logic doesn't explicitly have "RELA or REL" logic,
> it kind of does both; but I think it's a true invariant that
> it_a->second != 0 implies *it_addend_size == 0 and *it_addend_size !=
> 0 implies it_a->second == 0 (that is, it_a->second is always 0 for
> REL, and *it_addend_size is always 0 for RELA).  So a single function
> get_reloc_addend that takes it_a->second (the RELA addend) as an
> argument that it returns in the *it_addend_size == 0 case would do it
> nicely (or just don't bother breaking it out as a subroutine and just
> make addend and reloc_addend_value a single variable set from
> it_a->second in case 0, with the negative-value logic coming
> afterwards.

Sorry, Roland, I'm not sure what point you're trying to make. I don't
see how any of what you wrote contradicts my review comments. The
logic to handle "ignore added when negative" is in fact outside the
routine to fetch the addend from section contents (with or without my
suggested changes).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]