Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: VAX shard libraries broken



On Sun, Aug 26, 2012 at 10:49:38AM +0200, Martin Husemann wrote:
> For some reason libc.so.12.185 does not have a PLT anymore, i.e. the
> sections PLTGOT, PLTRELSZ, PLTREL and JMPREL are missing.
> 
> This breaks all shared linked binaries (no suprise). However, I have a hard
> time seeing what recent change did cause this.

Noticing that it also happend on latest -6 and looking at the few relevant
changes that had been pulled up, it was actuallly quite easy to spot.

This hack avoids the problem, probably easy to fix for real. Matt?

Martin

Index: elf32-vax.c
===================================================================
RCS file: /cvsroot/src/external/gpl3/binutils/dist/bfd/elf32-vax.c,v
retrieving revision 1.5.2.1
diff -c -u -r1.5.2.1 elf32-vax.c
--- elf32-vax.c 25 Jul 2012 15:09:34 -0000      1.5.2.1
+++ elf32-vax.c 26 Aug 2012 09:49:20 -0000
@@ -973,10 +973,20 @@
   if (h->type == STT_FUNC
       || h->needs_plt)
     {
+#if 0
       if (h->plt.refcount == 0
          || SYMBOL_CALLS_LOCAL (info, 0)
          || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
              && h->root.type == bfd_link_hash_undefweak))
+#else
+      if (! info->shared
+        && !h->def_dynamic
+        && !h->ref_dynamic
+        /* We must always create the plt entry if it was referenced
+           by a PLTxxO relocation.  In this case we already recorded
+           it as a dynamic symbol.  */
+        && h->dynindx == -1)
+#endif
        {
          /* This case can occur if we saw a PLTxx reloc in an input
             file, but the symbol was never referred to by a dynamic



Home | Main Index | Thread Index | Old Index