This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Fix visibility for MIPS (Re: 2 problems with ELF visibility)
On Wed, Apr 24, 2002 at 11:53:06PM +0930, Alan Modra wrote:
> On Mon, Apr 22, 2002 at 12:44:47PM -0700, H . J . Lu wrote:
> > I am enclosing a patch here. Any comments?
> >
> > * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local.
> > (mips_elf_link_hash_newfunc): Initialize forced_local to false.
> > (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol
> > to hide a global symbol.
> > (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set
> > forced_local to true.
>
> The idea seems reasonable, but why can't you use ELF_LINK_FORCED_LOCAL
> instead of using a new flag?
>
The whole problem is setting ELF_LINK_FORCED_LOCAL directly in
_bfd_elf_link_record_dynamic_symbol. If we can avoid that, I can
check it in _bfd_mips_elf_hide_symbol. Maybe, I should make a new
function
_bfd_elf_link_hash_force_local
which should be called on both dynamic and static symbols, instead of doing
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
H.J.