PATCH: Optimize protected call for i386

H. J. Lu hjl@lucon.org
Thu May 15 05:37:00 GMT 2003


This patch optimizes protected call for i386. 


H.J.
-------------- next part --------------
2003-05-14  H.J. Lu <hongjiu.lu@intel.com>

	* elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL for
	dynreloc check. 
	(elf_i386_relocate_section): Use SYMBOL_CALLS_LOCAL for .got
	relocs.

	* reloc.c (BFD_RELOC_386_PC32_DATA): Added.

	* elflink.c (_bfd_elf_fix_symbol_flags): Also hide protected
	symbol.

--- bfd/elf32-i386.c.protected	Tue May 13 08:42:28 2003
+++ bfd/elf32-i386.c	Wed May 14 22:30:29 2003
@@ -1679,7 +1679,7 @@ allocate_dynrelocs (h, inf)
 
   if (info->shared)
     {
-      if (SYMBOL_REFERENCES_LOCAL (info, h))
+      if (SYMBOL_CALLS_LOCAL (info, h))
 	{
 	  struct elf_i386_dyn_relocs **pp;
 
@@ -2434,7 +2434,7 @@ elf_i386_relocate_section (output_bfd, i
 		   || h->root.type != bfd_link_hash_undefweak)
 	       && (r_type != R_386_PC32
 		   || (h != NULL
-		       && !SYMBOL_REFERENCES_LOCAL (info, h))))
+		       && !SYMBOL_CALLS_LOCAL (info, h))))
 	      || (ELIMINATE_COPY_RELOCS
 		  && !info->shared
 		  && h != NULL
--- bfd/elflink.c.protected	Fri May  9 08:10:56 2003
+++ bfd/elflink.c	Wed May 14 22:31:10 2003
@@ -2436,8 +2436,7 @@ _bfd_elf_fix_symbol_flags (h, eif)
       && eif->info->shared
       && is_elf_hash_table (eif->info)
       && (eif->info->symbolic
-	  || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
-	  || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
+	  || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
       && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
     {
       struct elf_backend_data *bed;


More information about the Binutils mailing list