public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* RFC: Fix ia64 visibility
@ 2003-05-06 23:04 H. J. Lu
  2003-05-07 18:12 ` Richard Henderson
  2003-05-07 23:19 ` Jim Wilson
  0 siblings, 2 replies; 10+ messages in thread
From: H. J. Lu @ 2003-05-06 23:04 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

On ia64, when we hide a symbol, we clear the want_plt2 field, but not
want_plt. I don't see a reason not to. Also, if we don't need dynamic
symbol lookup, which is true for symbols with non-default visibility,
we should avoid it. Is this patch OK?


H.J.

[-- Attachment #2: bfd-ia64-protected.patch --]
[-- Type: text/plain, Size: 1381 bytes --]

2003-05-06  H.J. Lu <hongjiu.lu@intel.com>

	* elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the
	want_plt field.
	(elfNN_ia64_relocate_section): Don't do dynamic symbol lookup
	for symbols with non-default visibility.

--- bfd/elfxx-ia64.c.hjl	2003-05-05 08:27:08.000000000 -0700
+++ bfd/elfxx-ia64.c	2003-05-06 15:42:59.000000000 -0700
@@ -1792,7 +1792,10 @@ elfNN_ia64_hash_hide_symbol (info, xh, f
   _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local);
 
   for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next)
-    dyn_i->want_plt2 = 0;
+    {
+      dyn_i->want_plt2 = 0;
+      dyn_i->want_plt = 0;
+    }
 }
 
 /* Create the derived linker hash table.  The IA-64 ELF port uses this
@@ -4033,7 +4036,8 @@ elfNN_ia64_relocate_section (output_bfd,
 	      /* If we don't need dynamic symbol lookup, find a
 		 matching RELATIVE relocation.  */
 	      dyn_r_type = r_type;
-	      if (dynamic_symbol_p)
+	      if (dynamic_symbol_p
+		  && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
 		{
 		  dynindx = h->dynindx;
 		  addend = rel->r_addend;
@@ -4362,7 +4366,8 @@ elfNN_ia64_relocate_section (output_bfd,
 
 	      /* If we don't need dynamic symbol lookup, install two
 		 RELATIVE relocations.  */
-	      if (! dynamic_symbol_p)
+	      if (! dynamic_symbol_p
+		  || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
 		{
 		  unsigned int dyn_r_type;
 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-05-08 14:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-06 23:04 RFC: Fix ia64 visibility H. J. Lu
2003-05-07 18:12 ` Richard Henderson
2003-05-07 18:19   ` H. J. Lu
2003-05-07 22:32     ` Richard Henderson
2003-05-07 23:15       ` H. J. Lu
2003-05-07 23:19         ` Richard Henderson
2003-05-08  5:51           ` H. J. Lu
2003-05-08  8:04             ` Richard Henderson
2003-05-08 14:16               ` H. J. Lu
2003-05-07 23:19 ` Jim Wilson

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).