From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31939 invoked by alias); 6 May 2003 23:04:04 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 31932 invoked from network); 6 May 2003 23:04:03 -0000 Received: from unknown (HELO rwcrmhc53.attbi.com) (204.127.198.39) by sources.redhat.com with SMTP; 6 May 2003 23:04:03 -0000 Received: from lucon.org (12-234-88-5.client.attbi.com[12.234.88.5]) by attbi.com (rwcrmhc53) with ESMTP id <2003050623040305300ooh00e>; Tue, 6 May 2003 23:04:03 +0000 Received: by lucon.org (Postfix, from userid 1000) id 4013D2C681; Tue, 6 May 2003 16:04:02 -0700 (PDT) Date: Tue, 06 May 2003 23:04:00 -0000 From: "H. J. Lu" To: binutils@sources.redhat.com Subject: RFC: Fix ia64 visibility Message-ID: <20030506160402.B11085@lucon.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-SW-Source: 2003-05/txt/msg00178.txt.bz2 --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 255 On ia64, when we hide a symbol, we clear the want_plt2 field, but not want_plt. I don't see a reason not to. Also, if we don't need dynamic symbol lookup, which is true for symbols with non-default visibility, we should avoid it. Is this patch OK? H.J. --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bfd-ia64-protected.patch" Content-length: 1381 2003-05-06 H.J. Lu * elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the want_plt field. (elfNN_ia64_relocate_section): Don't do dynamic symbol lookup for symbols with non-default visibility. --- bfd/elfxx-ia64.c.hjl 2003-05-05 08:27:08.000000000 -0700 +++ bfd/elfxx-ia64.c 2003-05-06 15:42:59.000000000 -0700 @@ -1792,7 +1792,10 @@ elfNN_ia64_hash_hide_symbol (info, xh, f _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local); for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next) - dyn_i->want_plt2 = 0; + { + dyn_i->want_plt2 = 0; + dyn_i->want_plt = 0; + } } /* Create the derived linker hash table. The IA-64 ELF port uses this @@ -4033,7 +4036,8 @@ elfNN_ia64_relocate_section (output_bfd, /* If we don't need dynamic symbol lookup, find a matching RELATIVE relocation. */ dyn_r_type = r_type; - if (dynamic_symbol_p) + if (dynamic_symbol_p + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) { dynindx = h->dynindx; addend = rel->r_addend; @@ -4362,7 +4366,8 @@ elfNN_ia64_relocate_section (output_bfd, /* If we don't need dynamic symbol lookup, install two RELATIVE relocations. */ - if (! dynamic_symbol_p) + if (! dynamic_symbol_p + || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) { unsigned int dyn_r_type; --W/nzBZO5zC0uMSeA--