powerpc64 --gc-sections

Alan Modra amodra@bigpond.net.au
Tue Aug 6 22:19:00 GMT 2002


Fixes selective* ld testsuite failures.

bfd/ChangeLog
	* elf64-ppc.c (edit_opd): Arrange to drop symbols for discarded .opd
	entries.

Actually, they're not completely dropped from the symbol table, just
the name is zeroed out.

eg.
    19: 0000000000000000   408 OBJECT  GLOBAL DEFAULT  ABS 
    24: 0000000000000000    24 FUNC    GLOBAL DEFAULT  ABS 
    27: 0000000000000000    24 NOTYPE  GLOBAL DEFAULT  ABS 

Anybody know why we shouldn't drop them completely by changing
elflink.h:6345 from

 /* If we're stripping it, then it was just a dynamic symbol, and
     there's nothing else to do.  */
  if (strip)
    return true;

to

  if (strip || (input_sec->flags & SEC_EXCLUDE) != 0)
    return true;

?

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.61
diff -u -p -r1.61 elf64-ppc.c
--- bfd/elf64-ppc.c	6 Aug 2002 09:09:08 -0000	1.61
+++ bfd/elf64-ppc.c	7 Aug 2002 05:05:25 -0000
@@ -3753,7 +3753,23 @@ edit_opd (obfd, info)
 		    }
 
 		  skip = sym_sec->output_section == bfd_abs_section_ptr;
-		  if (!skip)
+		  if (skip)
+		    {
+		      if (h != NULL)
+			{
+			  /* Arrange for the function descriptor sym
+			     to be dropped.  */
+			  struct elf_link_hash_entry *fdh;
+			  struct ppc_link_hash_entry *fh;
+
+			  fh = (struct ppc_link_hash_entry *) h;
+			  BFD_ASSERT (fh->is_func);
+			  fdh = fh->oh;
+			  fdh->root.u.def.value = 0;
+			  fdh->root.u.def.section = sym_sec;
+			}
+		    }
+		  else
 		    {
 		      /* We'll be keeping this opd entry.  */
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list