Dynamic Linkage Problem

Uncle George gatgul@voicenet.com
Sat Sep 19 08:24:00 GMT 1998

while ur at it
    can u ( if u havent allready ) fix a LD bug related to the alpha. the
.dynsym section should be cleared out on the alpha before use. Some entries
in the  table are not cleared when the table becomes populated, and random
numbers are left within the table. An example would be the libdl.so
distributed with the 6cd jewel set. It has bogus entries that causes gdb to
go core.
I had posted this patch before, but dont know what happened to it - if

in bfd/elflink.h @ 2733 u should use a zmalloc

      /* Set the size of the .dynsym and .hash sections.  We counted
  the number of dynamic symbols in elf_link_add_object_symbols.
  We will build the contents of .dynsym and .hash when we build
  the final symbol table, because until then we do not know the
  correct value to give the symbols.  We built the .dynstr
  section as we went along in elf_link_add_object_symbols.  */
      s = bfd_get_section_by_name (dynobj, ".dynsym");
      BFD_ASSERT (s != NULL);
      s->_raw_size = dynsymcount * sizeof (Elf_External_Sym);
      s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size); /*
[gb] */
/* memset( s->contents, 0xff, s->_raw_size); */    /* [gb] insure corruption
      if (s->contents == NULL && s->_raw_size != 0)
 return false;

      /* The first entry in .dynsym is a dummy symbol.  */

Richard Henderson wrote:

> On Fri, Sep 18, 1998 at 10:12:18AM -0400, Bret Orsburn wrote:
> > (Dynamic linkage of a very large library under RedHat Alpha Linux 5.1 +
> > egcs-1.1b + glibc-2.0.7-19).
> Yep, a binutils bug fixed day before yesterday.  The problem being
> that there were missing RELATIVE dynamic relocations for the secondary
> .got.plt entries that get created when the initial .got subsegment
> gets too big.
> H.J. put out a new binutils minor release containing the fix.

-------------- next part --------------
Subject: Re: striped shared ELF lib & GDB
Date: Wed, 17 Jun 1998 17:23:08 -0400
From: Uncle George <gatgul@voicenet.com>
Organization: None Avail
To: bug-gnu-utils@gnu.org
CC: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>,
     "axp-list@redhat.com" <axp-list@redhat.com>,
     "Jay.Estabrook@digital.com" <Jay.Estabrook@digital.com>

for the alpha/redhat/5.0 with ld 2.9.1 there is a problem with clearing out the
.dynsym table. IT JUST ISN'T DONE. what ever is left over in the memory allocated
by bfd_alloc() elflink.h:2564 is ( on occasion used, by virtue of it not being
cleared ) as a bogus dynsym entry. Later on when the table is finally populated ,
any skipped entries ( done by elf64_alpha_finish_dynamic_sections() ) will not
have been zeroed!

ergo change the bfd_alloc() to bfd_zalloc()  @ elflink.h:2564.

this will make my gdb happy, objdump happy as can be.

Peter.Schauer wrote:

> This looks more like a linker problem, although GDB shouldn't dump core.
> Unfortunately I don't have access to alpha Linux, but I could try to
> re

More information about the Gcc mailing list