From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3690 invoked by alias); 19 Feb 2002 00:23:50 -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 3601 invoked from network); 19 Feb 2002 00:23:42 -0000 Received: from unknown (HELO mta03bw.bigpond.com) (139.134.6.86) by sources.redhat.com with SMTP; 19 Feb 2002 00:23:42 -0000 Received: from bubble.local ([144.135.24.81]) by mta03bw.bigpond.com (Netscape Messaging Server 4.15) with SMTP id GRR7RF00.B54 for ; Tue, 19 Feb 2002 10:23:39 +1000 Received: from CPE-144-136-176-14.sa.bigpond.net.au ([144.136.176.14]) by bwmam05.mailsvc.email.bigpond.com(MailRouter V3.0i 44/4718541); 19 Feb 2002 10:23:39 Received: (qmail 29700 invoked by uid 179); 19 Feb 2002 00:23:39 -0000 Date: Mon, 18 Feb 2002 17:11:00 -0000 From: Alan Modra To: binutils@sources.redhat.com Subject: elf_backend_hide_symbol Message-ID: <20020219002339.GR1054@bubble.sa.bigpond.net.au> Mail-Followup-To: binutils@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.25i X-SW-Source: 2002-02/txt/msg00688.txt.bz2 There's a minor problem with the way elf_backend_hide_symbol interacts with elf_link_output_extsyms: If linking an application (as distinct from a shared library), any symbol forced local due to symbol visibility will not appear in the output file as a local symbol. Instead, it disappears. The obvious thing to do is hack things so that elf_link_output_extsyms is called for these symbols. However, that means the backend adjust_dynamic_symbol routine will be called on a new set of symbols, with possibly bad results. * elflink.h (elf_bfd_final_link): Call elf_link_output_extsym to output forced local syms for non-shared link. (elf_link_output_extsym): Tweak condition for calling backend adjust_dynamic_symbol so that previous behaviour is kept. Really, what I'd like to do is leave out the second hunk and fix any breakage. There are backends that could benefit from calling the backend adjust_dynamic_symbol function on all dynamic syms, eg. hppa-linux. Comments? -- Alan Modra IBM OzLabs - Linux Technology Centre Index: bfd/elflink.h =================================================================== RCS file: /cvs/src/src/bfd/elflink.h,v retrieving revision 1.141 diff -u -p -r1.141 elflink.h --- elflink.h 2002/01/21 10:29:07 1.141 +++ elflink.h 2002/02/18 13:33:19 @@ -5304,7 +5304,7 @@ elf_bfd_final_link (abfd, info) can, we still need to deal with those global symbols that got converted to local in a version script. */ - if (info->shared) + if (1 || info->shared) { /* Output any global symbols that got converted to local in a version script. We do this in a separate step since ELF @@ -6033,6 +6033,8 @@ elf_link_output_extsym (h, data) symbol. */ if ((h->dynindx != -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) + && (finfo->info->shared + || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) && elf_hash_table (finfo->info)->dynamic_sections_created) { struct elf_backend_data *bed;