Skip to content

Commit

Permalink
* elflink.c (_bfd_elf_merge_symbol): Use local var holding value
Browse files Browse the repository at this point in the history
	of *sym_hash.
  • Loading branch information
Alan Modra committed Mar 25, 2013
1 parent 4279f79 commit dc822f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
5 changes: 5 additions & 0 deletions bfd/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2013-03-25 Alan Modra <amodra@gmail.com>

* elflink.c (_bfd_elf_merge_symbol): Use local var holding value
of *sym_hash.

2013-03-25 Alan Modra <amodra@gmail.com>

* elflink.c (_bfd_elf_merge_symbol): Don't discard TLS symbols here.
Expand Down
22 changes: 10 additions & 12 deletions bfd/elflink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,21 +1185,19 @@ _bfd_elf_merge_symbol (bfd *abfd,
/* If the new symbol with non-default visibility comes from a
relocatable file and the old definition comes from a dynamic
object, we remove the old definition. */
if ((*sym_hash)->root.type == bfd_link_hash_indirect)
if (hi->root.type == bfd_link_hash_indirect)
{
/* Handle the case where the old dynamic definition is
default versioned. We need to copy the symbol info from
the symbol with default version to the normal one if it
was referenced before. */
if (h->ref_regular)
{
struct elf_link_hash_entry *vh = *sym_hash;

vh->root.type = h->root.type;
hi->root.type = h->root.type;
h->root.type = bfd_link_hash_indirect;
(*bed->elf_backend_copy_indirect_symbol) (info, vh, h);
(*bed->elf_backend_copy_indirect_symbol) (info, hi, h);

h->root.u.i.link = (struct bfd_link_hash_entry *) vh;
h->root.u.i.link = (struct bfd_link_hash_entry *) hi;
if (ELF_ST_VISIBILITY (sym->st_other) != STV_PROTECTED)
{
/* If the new symbol is hidden or internal, completely undo
Expand All @@ -1216,10 +1214,10 @@ _bfd_elf_merge_symbol (bfd *abfd,
h->size = 0;
h->type = 0;

h = vh;
h = hi;
}
else
h = *sym_hash;
h = hi;
}

/* If the old symbol was undefined before, then it will still be
Expand Down Expand Up @@ -1496,8 +1494,8 @@ _bfd_elf_merge_symbol (bfd *abfd,
*type_change_ok = TRUE;
}

if ((*sym_hash)->root.type == bfd_link_hash_indirect)
flip = *sym_hash;
if (hi->root.type == bfd_link_hash_indirect)
flip = hi;
else
/* This union may have been set to be non-NULL when this symbol
was seen in a dynamic object. We must force the union to be
Expand Down Expand Up @@ -1542,8 +1540,8 @@ _bfd_elf_merge_symbol (bfd *abfd,
*size_change_ok = TRUE;
*type_change_ok = TRUE;

if ((*sym_hash)->root.type == bfd_link_hash_indirect)
flip = *sym_hash;
if (hi->root.type == bfd_link_hash_indirect)
flip = hi;
else
h->verinfo.vertree = NULL;
}
Expand Down

0 comments on commit dc822f1

Please sign in to comment.