public inbox for bfd@sourceware.org
 help / color / mirror / Atom feed
From: Manfred Hollstein <manfred@s-direktnet.de>
To: rth@cygnus.com
Cc: bfd@cygnus.com, gas2@cygnus.com, Manfred.Hollstein@ks.sel.alcatel.de
Subject: Re: Bugs in recent snapshots on Solaris
Date: Fri, 13 Mar 1998 01:21:00 -0000	[thread overview]
Message-ID: <13576.63996.735032.948934@slsvhmt> (raw)
In-Reply-To: <13576.61624.313896.482781@slsvhmt>

On Fri, 13 March 1998, 09:46:33, manfred@s-direktnet.de wrote:

 > Didn't anybody else see this? When make check is running the shared
 > tests in the ld directory, it'll never stop. Instead I'll get a CPU
 > hungry process tmpdir/shp running and running and ... I have no idea
 > what it's doing, size won't change (increase or decrease), but it
 > really hogs my CPU (top reports right now 0.0% idle!).
 > 
 > This is with yesterday's snapshot (gas-980312), but I've observed it
 > with 0303 as well. I haven't investigated, when this problem has been
 > introduced, but at least 980219 is working without problems.
 > 
 > Interestingly, this only happens on sparc-sun-solaris2.5.1, not on
 > sparc-sun-sunos4.1.4.

In the meantime I tracked this down to this change from 980224:

Sun Feb 22 20:39:00 1998  Richard Henderson  <rth@cygnus.com>

	* elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Don't create
 	a plt entry when we can determine that we authoritatively define
 	the symbol.

diff -u -r --new-file --show-function-line=^[A-Za-z_] /home/raeburn/offsite/snap/old/gas-980219/bfd/elf32-sparc.c ./bfd/elf32-sparc.c
--- /home/raeburn/offsite/snap/old/gas-980219/bfd/elf32-sparc.c	Thu Feb 19 01:14:03 1998
+++ ./bfd/elf32-sparc.c	Tue Feb 24 01:14:08 1998
@@ -593,14 +593,22 @@ elf32_sparc_adjust_dynamic_symbol (info,
 	      || h->root.type == bfd_link_hash_defweak)
 	  && (h->root.u.def.section->flags & SEC_CODE) != 0))
     {
-      if (! elf_hash_table (info)->dynamic_sections_created)
+      if (! elf_hash_table (info)->dynamic_sections_created
+	  || ((!info->shared || info->symbolic || h->dynindx == -1)
+	      && (h->elf_link_hash_flags
+		  & ELF_LINK_HASH_DEF_REGULAR) != 0))
 	{
 	  /* This case can occur if we saw a WPLT30 reloc in an input
-             file, but none of the input files were dynamic objects.
-             In such a case, we don't actually need to build a
-             procedure linkage table, and we can just do a WDISP30
-             reloc instead.  */
-	  BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
+	     file, but none of the input files were dynamic objects.
+	     Or, when linking the main application or a -Bsymbolic
+	     shared library against PIC code.  Or when a global symbol
+	     has been made private, e.g. via versioning.
+
+	     In these cases we know what value the symbol will resolve
+	     to, so we don't actually need to build a procedure linkage
+	     table, and we can just do a WDISP30 reloc instead.  */
+
+	  h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
 	  return true;
 	}
 
@@ -618,17 +626,11 @@ elf32_sparc_adjust_dynamic_symbol (info,
 	  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;
-	}
+      /* 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.  */
+      h->root.u.def.section = s;
+      h->root.u.def.value = s->_raw_size;
 
       h->plt_offset = s->_raw_size;
 

I reverted this patch, re-built and did make check - now it runs!
Richard, can you please take a look at it?

Thanks

manfred

  reply	other threads:[~1998-03-13  1:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-13  0:47 Manfred Hollstein
1998-03-13  1:21 ` Manfred Hollstein [this message]
1998-03-13 16:09   ` Ken Raeburn
1998-03-20  2:30   ` Richard Henderson
1998-03-20  8:19     ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13576.63996.735032.948934@slsvhmt \
    --to=manfred@s-direktnet.de \
    --cc=Manfred.Hollstein@ks.sel.alcatel.de \
    --cc=bfd@cygnus.com \
    --cc=gas2@cygnus.com \
    --cc=rth@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).