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


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

A patch for visibility.


Martin,

I believe we should clear the visibility field for undefined symbols.
What do you think?


-- 
H.J. Lu (hjl@gnu.org)
---
2000-05-19  H.J. Lu  <hjl@gnu.org>

	* elflink.h (elf_link_output_extsym): Clear the visibility
	field for undefined symbols.

Index: elflink.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elflink.h,v
retrieving revision 1.26
diff -u -p -r1.26 elflink.h
--- elflink.h	2000/05/18 22:10:35	1.26
+++ elflink.h	2000/05/19 20:03:33
@@ -5089,6 +5089,10 @@ elf_link_output_extsym (h, data)
       sym.st_info = ELF_ST_INFO (bindtype, ELF_ST_TYPE (sym.st_info));
     }
 
+  /* If a symbol is undefined, we clear the visibility field. */
+  if (sym.st_shndx == SHN_UNDEF)
+    sym.st_other &= ~ELF_ST_VISIBILITY(sym.st_other);
+
   /* If this symbol should be put in the .dynsym section, then put it
      there now.  We have already know the symbol index.  We also fill
      in the entry in the .hash section.  */

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