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]

Re: [patch] PPC small data symbols in shared libraries.


On Tuesday 28 June 2005 22:44, Eric Christopher wrote:
> >  {
> > +  /* Ignore small data symbols exported from shared libraries.  */
> > +  if ((abfd->flags & DYNAMIC) != 0
> > +      && (strcmp (*namep, "_SDA_BASE_") == 0
> > +         || strcmp (*namep, "_SDA2_BASE_") == 0))
>
> I'd make the comment clearer about why we're ignoring them.

Attached patch does this. No functional changes.

Ok?

Paul
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.163
diff -u -p -r1.163 elf32-ppc.c
--- bfd/elf32-ppc.c	23 May 2005 16:22:25 -0000	1.163
+++ bfd/elf32-ppc.c	28 Jun 2005 20:25:51 -0000
@@ -2617,6 +2729,17 @@ ppc_elf_add_symbol_hook (bfd *abfd,
 			 asection **secp,
 			 bfd_vma *valp)
 {
+  /* Ignore small data symbols exported from shared libraries.
+     Small data sections are only meaningful in executables, but some
+     (arguably broken) shared libraries export the base symbols anyway.  */
+  if ((abfd->flags & DYNAMIC) != 0
+      && (strcmp (*namep, "_SDA_BASE_") == 0
+	  || strcmp (*namep, "_SDA2_BASE_") == 0))
+    {
+      *namep = NULL;
+      return TRUE;
+    }
+
   if (sym->st_shndx == SHN_COMMON
       && !info->relocatable
       && sym->st_size <= elf_gp_size (abfd)

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