* elf-bfd.h (_bfd_elf_strtab_refcount): Declare.
* elf-strtab.c (_bfd_elf_strtab_refcount): New function. * elflink.c (elf_add_dt_needed_tag): Use _bfd_elf_strtab_refcount.
This commit is contained in:
parent
a4542f1b23
commit
02be4619f1
4 changed files with 15 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2013-01-12 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* elf-bfd.h (_bfd_elf_strtab_refcount): Declare.
|
||||||
|
* elf-strtab.c (_bfd_elf_strtab_refcount): New function.
|
||||||
|
* elflink.c (elf_add_dt_needed_tag): Use _bfd_elf_strtab_refcount.
|
||||||
|
|
||||||
2013-01-12 Alan Modra <amodra@gmail.com>
|
2013-01-12 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
PR ld/12549
|
PR ld/12549
|
||||||
|
|
|
@ -1938,6 +1938,8 @@ extern void _bfd_elf_strtab_addref
|
||||||
(struct elf_strtab_hash *, bfd_size_type);
|
(struct elf_strtab_hash *, bfd_size_type);
|
||||||
extern void _bfd_elf_strtab_delref
|
extern void _bfd_elf_strtab_delref
|
||||||
(struct elf_strtab_hash *, bfd_size_type);
|
(struct elf_strtab_hash *, bfd_size_type);
|
||||||
|
extern unsigned int _bfd_elf_strtab_refcount
|
||||||
|
(struct elf_strtab_hash *, bfd_size_type);
|
||||||
extern void _bfd_elf_strtab_clear_refs
|
extern void _bfd_elf_strtab_clear_refs
|
||||||
(struct elf_strtab_hash *, bfd_size_type);
|
(struct elf_strtab_hash *, bfd_size_type);
|
||||||
#define _bfd_elf_strtab_clear_all_refs(tab) \
|
#define _bfd_elf_strtab_clear_all_refs(tab) \
|
||||||
|
|
|
@ -201,6 +201,12 @@ _bfd_elf_strtab_delref (struct elf_strtab_hash *tab, bfd_size_type idx)
|
||||||
--tab->array[idx]->refcount;
|
--tab->array[idx]->refcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
_bfd_elf_strtab_refcount (struct elf_strtab_hash *tab, bfd_size_type idx)
|
||||||
|
{
|
||||||
|
return tab->array[idx]->refcount;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_bfd_elf_strtab_clear_refs (struct elf_strtab_hash *tab, bfd_size_type idx)
|
_bfd_elf_strtab_clear_refs (struct elf_strtab_hash *tab, bfd_size_type idx)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3091,19 +3091,17 @@ elf_add_dt_needed_tag (bfd *abfd,
|
||||||
bfd_boolean do_it)
|
bfd_boolean do_it)
|
||||||
{
|
{
|
||||||
struct elf_link_hash_table *hash_table;
|
struct elf_link_hash_table *hash_table;
|
||||||
bfd_size_type oldsize;
|
|
||||||
bfd_size_type strindex;
|
bfd_size_type strindex;
|
||||||
|
|
||||||
if (!_bfd_elf_link_create_dynstrtab (abfd, info))
|
if (!_bfd_elf_link_create_dynstrtab (abfd, info))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
hash_table = elf_hash_table (info);
|
hash_table = elf_hash_table (info);
|
||||||
oldsize = _bfd_elf_strtab_size (hash_table->dynstr);
|
|
||||||
strindex = _bfd_elf_strtab_add (hash_table->dynstr, soname, FALSE);
|
strindex = _bfd_elf_strtab_add (hash_table->dynstr, soname, FALSE);
|
||||||
if (strindex == (bfd_size_type) -1)
|
if (strindex == (bfd_size_type) -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (oldsize == _bfd_elf_strtab_size (hash_table->dynstr))
|
if (_bfd_elf_strtab_refcount (hash_table->dynstr, strindex) != 1)
|
||||||
{
|
{
|
||||||
asection *sdyn;
|
asection *sdyn;
|
||||||
const struct elf_backend_data *bed;
|
const struct elf_backend_data *bed;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue