New partial_inplace comment

Ian Lance Taylor ian@zembu.com
Tue Feb 29 12:51:00 GMT 2000


   From: Doug Evans <dje@transmeta.com>
   Date: Tue, 29 Feb 2000 12:28:29 -0800 (PST)

   Ian Lance Taylor writes:

    >    How can partial linking work on a USE_REL target for relocations
    >    that have partial_inplace == FALSE?!
    >    I suspect what's going on is that in fact such relocations _do_
    >    have partial_inplace == TRUE from a semantic point of view, but either
    >    - the implementation doesn't use partial_inplace (so any value will do)
    >    - the implementation would like to set partial_inplace to TRUE, but
    >      something breaks somewhere
    >    - the implementation, while not broken, is confused
    >    - the implementation is broken
    > 
    > Do you want to point out any cases you find confusing?

   m32r and d10v are both USE_REL.
   However, for what are (superficially) similar relocs
   (R_D10V_16/R_M32R_16, R_D10V_32/R_M32R_32)
   d10v sets partial_inplace to false, m32r sets it to true.
   The intuitively correct choice is `true' (right?).
   Intuition tells me either the d10v port has had to go to extra lengths
   to be correct or it has a bug (though fixing it may involve a
   non-upward compatible change: can you change partial_inplace on a
   USE_REL target in an upward compatible manner?  I dunno.).

I agree.  The d10v port is broken.

When I look at elf32_d10v_relocate_section, I very much doubt that the
d10v supports ld -r.  I don't know if anybody cares about this target.

Normally if partial_inplace is false, src_mask is 0.  For the d10v,
src_mask is not zero.  So the target is working by having the
assembler stuff the right addend in place.

You can change partial_inplace in an upward compatible fashion.  It
mainly affects ld -r behaviour.  The assembler is mostly controlled by
md_apply_fix in gas.  As you know, the whole area is a huge mess.  The
d10v would also require changes in elf32_d10v_relocate_section.

Ian


More information about the Binutils mailing list