This is the mail archive of the binutils@sources.redhat.com 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]

[PATCH] SH: Fix the failure of crangerel2


Hi,

Now only one failure of ld testsuite on sh64-elf remained is
crangerel2.rd:

FAIL: Mixing SH64 assembler-generated with linker-generated .cranges, partial linking

and it's caused by the extra two R_SH_NONE relocations in
crangerel2.bin:

Relocation section '.rela.cranges' at offset 0x2e0 contains 9 entries:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
...
0000003c  00000201 R_SH_DIR32        00000000   .text.mixed + 0
00000000  00000000 R_SH_NONE                                    00000000
00000000  00000000 R_SH_NONE                                    00000000

The patch below fixes this. It seems now the linker doesn't require
the hack removed by the patch. I'll check it in if there are no
objections.

Regards,
	kaz
--
2003-10-13  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* ld/emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocat):
	Don't update the relocation counter of .cranges section here.

diff -u3prN ORIG/src/ld/emultempl/sh64elf.em LOCAL/src/ld/emultempl/sh64elf.em
--- ORIG/src/ld/emultempl/sh64elf.em	Sat Jul 19 13:08:11 2003
+++ LOCAL/src/ld/emultempl/sh64elf.em	Mon Oct 13 14:31:33 2003
@@ -522,13 +522,6 @@ sh64_elf_${EMULATION_NAME}_after_allocat
 			bfd_put_32 (output_bfd, isec->output_offset,
 				    crangesp + SH64_CRANGE_CR_ADDR_OFFSET);
 			cr_addr_order->u.reloc.p->addend = 0;
-
-			/* We must update the number of relocations here,
-			   since the elf linker does not take link orders
-			   into account when setting header sizes.  The
-			   actual relocation orders are however executed
-			   correctly.  */
-			elf_section_data(cranges)->rel_count++;
 		      }
 		    else
 		      bfd_put_32 (output_bfd,


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