New partial_inplace comment

Doug Evans dje@transmeta.com
Mon Feb 28 17:12:00 GMT 2000


Comments before I check this in?
[This message doesn't include patches to regenerated files though
I will of course DTRT.]

The last bit about not all relocations of all ELF USE_REL targets
setting partial_inplace to TRUE could use some rewording.  I wanted
to document this (to me) rather confusing situation.  If someone
can clear up the confusion I'd like to put that explanation in the
comment.

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

Index: reloc.c
===================================================================
RCS file: /cvs/src/src/bfd/reloc.c,v
retrieving revision 1.11
diff -c -p -r1.11 reloc.c
*** reloc.c	2000/02/23 13:52:20	1.11
--- reloc.c	2000/02/29 01:03:27
*************** CODE_FRAGMENT
*** 340,347 ****
  .       {* The textual name of the relocation type. *}
  .  char *name;
  .
! .       {* When performing a partial link, some formats must modify the
! .          relocations rather than the data - this flag signals this.*}
  .  boolean partial_inplace;
  .
  .       {* The src_mask selects which parts of the read in data
--- 340,359 ----
  .       {* The textual name of the relocation type. *}
  .  char *name;
  .
! .       {* Some formats record a relocation addend in the section contents
! .          rather than with the relocation.  For ELF formats this is the
! .          distinction between USE_REL and USE_RELA (though the code checks
! .          for USE_REL == 1/0).  The value of this field is TRUE if the
! .          addend is recorded with the section contents; when performing a
! .          partial link (ld -r) the section contents (the data) will be
! .          modified.  The value of this field is FALSE if addends are
! .          recorded with the relocation; when performing a partial link the
! .          relocation will be modified.
! .          All relocations for all ELF USE_RELA targets should set this field
! .          to FALSE (values of TRUE should be looked on with suspicion).
! .          However, the converse is not true: not all relocations of all ELF
! .          USE_REL targets set this field to TRUE.  Why this is is peculiar
! .          to each particular target.  *}
  .  boolean partial_inplace;
  .
  .       {* The src_mask selects which parts of the read in data


More information about the Binutils mailing list