[PATCH] Support for R_SPARC_OLO10 relocations

Ian Lance Taylor ian@zembu.com
Thu Jul 8 20:02:00 GMT 1999


   Date: Mon, 5 Jul 1999 17:47:29 +0200
   From: Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>

   This patch adds support for R_SPARC_OLO10 relocation.
   It is in fact a compound relocation equal to R_SPARC_LO10 and R_SPARC_13
   with no symbol applied on top of it, so I have modelled the support from
   elf64-mips.c which already supports compound relocations.

Are you copying some existing ABI?  I ask because this implementation
seems overly complex.  There is already a place to store the addend:
the instruction itself.  I don't see any reason to store an additional
addend in the Rela structure.  The range of possible values would seem
to be limited by the nature of the relocation.

This patch seems to have several parts which are unrelated to
R_SPARC_OLO10 support, such as the readelf.c and the sparc-dis.c
patches.  Please submit unrelated patches separately.  That will speed
the process of checking them in.  Thanks.

   --- ./include/elf/sparc.h.jj	Tue Jun 29 10:51:49 1999
   +++ ./include/elf/sparc.h	Mon Jul  5 14:44:35 1999
   @@ -138,9 +138,9 @@ END_RELOC_NUMBERS

    /* Relocation macros.  */

   -#define ELF64_R_TYPE_DATA(info)		(((bfd_vma) (info) << 32) >> 40)
   +#define ELF64_R_TYPE_DATA(info)		(((bfd_signed_vma) (info) << 32) >> 40)

This bit of the patch appears to assume that a right shift of a signed
value does an arithmetic shift.  However, C does not guarantee this:
the result of a right shift of a signed negative value is
implementation defined.

Ian


More information about the Binutils mailing list