This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Your bfd & ld patch breaks --as-needed on SPARC (and someother targets)
Alan Modra <amodra@bigpond.net.au> wrote:
> There are also some SH64 ld test failures that I haven't investigated.
> If I'm to blame, I'm willing to fix, but some analysis from SH people
> would be appreciated.
I've got 3 ld test failures for sh64-unknown-elf.
FAIL: Mixing SH64 assembler-generated with linker-generated .cranges, partial linking
FAIL: Sorted SH64 .cranges, entry at SHcompact code
FAIL: Sorted SH64 .cranges, entry at SHmedia code
It seems that the first failure is caused with the wrong ref_count for
.cranges section and the latter 2 errors are caused with the wrong rawsize
of .cranges. I'll check the attached patch in to fix them.
Regards,
kaz
-
2005-08-17 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation):
Don't increment rel_count of .cranges here. Set rawsize of .cranges.
diff -uprN ORIG/src/ld/emultempl/sh64elf.em LOCAL/src/ld/emultempl/sh64elf.em
--- ORIG/src/ld/emultempl/sh64elf.em 2005-05-17 08:29:12.000000000 +0900
+++ LOCAL/src/ld/emultempl/sh64elf.em 2005-08-17 10:15:59.000000000 +0900
@@ -520,13 +520,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,
@@ -564,4 +557,5 @@ sh64_elf_${EMULATION_NAME}_after_allocat
sh64_elf_section_data (cranges)->sh64_info->cranges_growth
= crangesp - cranges->contents - cranges->size;
cranges->size = crangesp - cranges->contents;
+ cranges->rawsize = cranges->size;
}