This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: New 64-bit PowerPC toolchain/GLIBC code drop
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com, Peter Bergner <bergner at us dot ibm dot com>, Stuart_Monteith/UK/IBM%IBMGB <monteith at uk dot ibm dot com>, Steve Munroe <sjmunroe at us dot ibm dot com>
- Date: Wed, 22 May 2002 13:51:21 +0930
- Subject: Re: New 64-bit PowerPC toolchain/GLIBC code drop
- References: <OF7EA82B23.C7606DFE-ON86256BC0.006647D6@rchland.ibm.com> <20020521233438.GN464@bubble.sa.bigpond.net.au> <20020521235133.GP464@bubble.sa.bigpond.net.au>
The comments tell the story.
* elf64-ppc.c (ppc64_elf_size_stubs): Don't strip .branch_lt.
(ppc64_elf_relocate_section): Handle unresolved relocs in opd.
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.42
diff -u -p -r1.42 elf64-ppc.c
--- bfd/elf64-ppc.c 22 May 2002 00:04:40 -0000 1.42
+++ bfd/elf64-ppc.c 22 May 2002 04:18:44 -0000
@@ -4834,12 +4834,10 @@ ppc64_elf_size_stubs (output_bfd, stub_b
(*htab->layout_sections_again) ();
}
- if (htab->sbrlt->_raw_size == 0)
- {
- _bfd_strip_section_from_output (info, htab->sbrlt);
- if (htab->srelbrlt != NULL)
- _bfd_strip_section_from_output (info, htab->srelbrlt);
- }
+ /* It would be nice to strip .branch_lt from the output if the
+ section is empty, but it's too late. If we strip sections here,
+ the dynamic symbol table is corrupted since the section symbol
+ for the stripped section isn't written. */
ret = true;
@@ -5559,6 +5557,16 @@ ppc64_elf_relocate_section (output_bfd,
relocate = true;
if (r_type == R_PPC64_ADDR64 || r_type == R_PPC64_TOC)
{
+ if (is_opd && h != NULL && info->shared)
+ {
+ /* Lie about opd entries. This case occurs
+ when building shared libraries and we
+ reference a function in another shared
+ lib. In that case we won't use the opd
+ entry in this lib; We ought to edit the
+ opd section to remove unused entries. */
+ unresolved_reloc = false;
+ }
outrel.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE);
}
else
--
Alan Modra
IBM OzLabs - Linux Technology Centre