public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: Code Address In VTable
       [not found] <1034302579.31498.116735.camel@brick>
@ 2002-10-10 21:34 ` Alan Modra
  2002-10-11  5:57   ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Modra @ 2002-10-10 21:34 UTC (permalink / raw)
  To: Michal Ostrowski; +Cc: dje, Peter Bergner, binutils

The last change I made to edit_opd broke linkonce function descriptor
symbols.  Previously, edit_opd only removed opd entries when a
function was completely unused and gc-sections removed the function.
With linkonce functions, we want to remove opd entries for all but
the bfd containing the kept function code, and _not_ zap the symbol.

	* elf64-ppc.c (edit_opd): Only zero opd syms when function
	completely removed.

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.66
diff -u -p -r1.66 elf64-ppc.c
--- bfd/elf64-ppc.c	8 Oct 2002 09:51:09 -0000	1.66
+++ bfd/elf64-ppc.c	11 Oct 2002 04:24:00 -0000
@@ -3762,7 +3762,7 @@ edit_opd (obfd, info)
 			  || sym_sec->output_section == bfd_abs_section_ptr);
 		  if (skip)
 		    {
-		      if (h != NULL)
+		      if (h != NULL && sym_sec->owner == ibfd)
 			{
 			  /* Arrange for the function descriptor sym
 			     to be dropped.  */

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Code Address In VTable
  2002-10-10 21:34 ` Code Address In VTable Alan Modra
@ 2002-10-11  5:57   ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2002-10-11  5:57 UTC (permalink / raw)
  To: binutils
  Cc: Michal Ostrowski, David Edelsohn, Peter Bergner, Olaf Hering,
	Andreas Jaeger

On Fri, Oct 11, 2002 at 02:04:28PM +0930, Alan Modra wrote:
> The last change I made to edit_opd broke linkonce function descriptor
> symbols.

More than that, the adjustment for local syms was wrong.

	* elf64-ppc.c (edit_opd): Correct local sym adjustment.

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.68
diff -u -p -r1.68 elf64-ppc.c
--- bfd/elf64-ppc.c	11 Oct 2002 08:33:11 -0000	1.68
+++ bfd/elf64-ppc.c	11 Oct 2002 12:48:52 -0000
@@ -3804,8 +3804,7 @@ edit_opd (obfd, info)
 			     for the function descriptor sym which we
 			     don't have at the moment.  So keep an
 			     array of adjustments.  */ 
-			  adjust[(rel->r_offset + wptr - rptr) / 24]
-			    = wptr - rptr;
+			  adjust[rel->r_offset / 24] = wptr - rptr;
 			}
 
 		      if (wptr != rptr)

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-11 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1034302579.31498.116735.camel@brick>
2002-10-10 21:34 ` Code Address In VTable Alan Modra
2002-10-11  5:57   ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).