From e5dfef09182bd9e1523f6bc5e9a44e60171ff3c8 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Thu, 31 Jan 2002 10:46:24 +0000 Subject: [PATCH] * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't unexport unreferenced symbols when --export-dynamic. Call _bfd_elf_strtab_delref when unexporting. --- bfd/ChangeLog | 6 ++++++ bfd/elf32-cris.c | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8781578c8f2..824e8517204 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2002-01-31 Hans-Peter Nilsson + + * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't + unexport unreferenced symbols when --export-dynamic. Call + _bfd_elf_strtab_delref when unexporting. + 2002-01-30 Daniel Jacobowitz * bfd-in.h: Include if it is available. diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 6feb292c191..c588adcc48b 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -2936,8 +2936,14 @@ elf_cris_discard_excess_program_dynamics (h, inf) /* If the locally-defined symbol isn't used by a DSO, then we don't have to export it as a dynamic symbol. This was already done for functions; doing this for all symbols would presumably not - introduce new problems. */ - h->root.dynindx = -1; + introduce new problems. Of course we don't do this if we're + exporting all dynamic symbols. */ + if (! info->export_dynamic) + { + h->root.dynindx = -1; + _bfd_elf_strtab_delref (elf_hash_table (info)->dynstr, + h->root.dynstr_index); + } } return true; -- 2.30.2