From: Alan Modra <amodra@bigpond.net.au>
To: binutils@sources.redhat.com
Subject: elf_backend_hide_symbol
Date: Mon, 18 Feb 2002 17:11:00 -0000 [thread overview]
Message-ID: <20020219002339.GR1054@bubble.sa.bigpond.net.au> (raw)
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;
next reply other threads:[~2002-02-19 0:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-18 17:11 Alan Modra [this message]
2002-03-04 21:17 ` elf_backend_hide_symbol Alan Modra
2002-03-04 21:24 ` elf_backend_hide_symbol Alan Modra
-- strict thread matches above, loose matches on Subject: below --
2002-01-21 3:02 elf_backend_hide_symbol Alan Modra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020219002339.GR1054@bubble.sa.bigpond.net.au \
--to=amodra@bigpond.net.au \
--cc=binutils@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).