This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Optimize protected call for i386
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Wed, 14 May 2003 22:45:57 -0700
- Subject: Re: PATCH: Optimize protected call for i386
- References: <20030514223716.A3911@lucon.org>
On Wed, May 14, 2003 at 10:37:16PM -0700, H. J. Lu wrote:
> This patch optimizes protected call for i386.
>
>
> H.J.
> 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.
Leftover.
>
> * elflink.c (_bfd_elf_fix_symbol_flags): Also hide protected
> symbol.
It doesn't really make a protected symbol local.
>
> --- 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;
The rest code looks like
{
struct elf_backend_data *bed;
bfd_boolean force_local;
bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
force_local = (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
|| ELF_ST_VISIBILITY (h->other) == STV_HIDDEN);
(*bed->elf_backend_hide_symbol) (eif->info, h, force_local);
}
A protected symbol is not forced local. It just clears the
ELF_LINK_HASH_NEEDS_PLT bit.
H.J.