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]

[PATCH] Fix handling of R_SPARC_UA32 relocation


On a sparc-sun-solaris2.6 system , GCC:

   gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)

produces R_SPARC_UA32 relocations, which the current CVS
binutils seem to mishandle somehow.  As a result the linker bootstrap
tests fail.

According to the Sun documentation:


     This relocation type resembles R_SPARC_32, except it refers to an
     unaligned word. That is, the word to be relocated must be treated
     as four separate bytes with arbitrary alignment, not as a word
     aligned according to the architecture requirements.

Therefore I think the attached patch is appropriate.  I don't think
the alignment issues are important for binutils.  Anyway, with this
patch the linker bootstrap tests succeed.

OK to check this in?


Index: ChangeLog
from  Mark Kettenis  <>

	* elf32-sparc.c (_bfd_sparc_elf_howto_table): Treat R_SPARC_UA32
	similar to R_SPARC_32.

Index: elf32-sparc.c
RCS file: /cvs/src/src/bfd/elf32-sparc.c,v
retrieving revision 1.16
diff -u -r1.16 elf32-sparc.c
--- elf32-sparc.c 2000/12/08 18:34:31 1.16
+++ elf32-sparc.c 2001/02/09 11:03:13
@@ -85,7 +85,7 @@
   HOWTO(R_SPARC_GLOB_DAT,  0,0,00,false,0,complain_overflow_dont,    bfd_elf_generic_reloc,  "R_SPARC_GLOB_DAT",false,0,0x00000000,true),
   HOWTO(R_SPARC_JMP_SLOT,  0,0,00,false,0,complain_overflow_dont,    bfd_elf_generic_reloc,  "R_SPARC_JMP_SLOT",false,0,0x00000000,true),
   HOWTO(R_SPARC_RELATIVE,  0,0,00,false,0,complain_overflow_dont,    bfd_elf_generic_reloc,  "R_SPARC_RELATIVE",false,0,0x00000000,true),
-  HOWTO(R_SPARC_UA32,      0,0,00,false,0,complain_overflow_dont,    bfd_elf_generic_reloc,  "R_SPARC_UA32",    false,0,0x00000000,true),
+  HOWTO(R_SPARC_UA32,      0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc,  "R_SPARC_UA32",    false,0,0xffffffff,true),
   HOWTO(R_SPARC_PLT32,     0,0,00,false,0,complain_overflow_dont,    sparc_elf_notsupported_reloc,  "R_SPARC_PLT32",    false,0,0x00000000,true),
   HOWTO(R_SPARC_HIPLT22,   0,0,00,false,0,complain_overflow_dont,    sparc_elf_notsupported_reloc,  "R_SPARC_HIPLT22",  false,0,0x00000000,true),
   HOWTO(R_SPARC_LOPLT10,   0,0,00,false,0,complain_overflow_dont,    sparc_elf_notsupported_reloc,  "R_SPARC_LOPLT10",  false,0,0x00000000,true),

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