This is the mail archive of the gas2@sourceware.cygnus.com mailing list for the gas2 project.


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

gld in gas-941027 is still broken


   From: hjl@nynexst.com (H.J. Lu)
   Date: Sat, 29 Oct 94 16:10:23 EDT

   > Could somebody please try to give me a reproducible test case for this
   > problem?

   Do you have a Linux system?

No.

   I think I have pinpointed where it went wrong. As I suspected, it looks
   the old bug I reported earlier. Your fix may be a partial one.

Yes, this was enough for me to recreate the problem on Solaris.  This
patch should fix the problem.  Ken, this patch should go into the
release.

Ian

Index: elf32-i386.c
===================================================================
RCS file: /rel/cvsfiles/devo/bfd/elf32-i386.c,v
retrieving revision 1.32
diff -p -r1.32 elf32-i386.c
*** elf32-i386.c	1994/10/27 21:25:29	1.32
--- elf32-i386.c	1994/10/30 03:20:54
*************** elf_i386_adjust_dynamic_symbol (info, h)
*** 647,657 ****
        if (s->_raw_size == 0)
  	s->_raw_size += PLT_ENTRY_SIZE;
  
!       /* If we are not generating a shared library, or if the symbol
!          is not defined, set the symbol to this location in the .plt.
!          This is required to make function pointers compare as equal
!          between the normal executable and the shared library.  */
!       if (! info->shared || h->root.type != bfd_link_hash_defined)
  	{
  	  h->root.u.def.section = s;
  	  h->root.u.def.value = s->_raw_size;
--- 647,659 ----
        if (s->_raw_size == 0)
  	s->_raw_size += PLT_ENTRY_SIZE;
  
!       /* If this symbol is not defined in a regular file, and we are
! 	 not generating a shared library, then set the symbol to this
! 	 location in the .plt.  This is required to make function
! 	 pointers compare as equal between the normal executable and
! 	 the shared library.  */
!       if (! info->shared
! 	  && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
  	{
  	  h->root.u.def.section = s;
  	  h->root.u.def.value = s->_raw_size;
Index: elf32-sparc.c
===================================================================
RCS file: /rel/cvsfiles/devo/bfd/elf32-sparc.c,v
retrieving revision 1.25
diff -p -r1.25 elf32-sparc.c
*** elf32-sparc.c	1994/10/27 21:25:31	1.25
--- elf32-sparc.c	1994/10/30 03:20:55
*************** elf32_sparc_adjust_dynamic_symbol (info,
*** 619,629 ****
  	  return false;
  	}
  
!       /* If we are not generating a shared library, or if the symbol
!          is not defined, set the symbol to this location in the .plt.
!          This is required to make function pointers compare as equal
!          between the normal executable and the shared library.  */
!       if (! info->shared || h->root.type != bfd_link_hash_defined)
  	{
  	  h->root.u.def.section = s;
  	  h->root.u.def.value = s->_raw_size;
--- 619,631 ----
  	  return false;
  	}
  
!       /* If this symbol is not defined in a regular file, and we are
! 	 not generating a shared library, then set the symbol to this
! 	 location in the .plt.  This is required to make function
! 	 pointers compare as equal between the normal executable and
! 	 the shared library.  */
!       if (! info->shared
! 	  && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
  	{
  	  h->root.u.def.section = s;
  	  h->root.u.def.value = s->_raw_size;