This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
A patch for visibility.
- To: loewis at informatik dot hu-berlin dot de
- Subject: A patch for visibility.
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Fri, 19 May 2000 13:07:07 -0700
- Cc: binutils at sourceware dot cygnus dot com
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. */