summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2005-09-19 23:30:05 +0000
committerAlan Modra <amodra@bigpond.net.au>2005-09-19 23:30:05 +0000
commit5016e13a8b701724c68f156b6292fada9878b968 (patch)
treeaae2a5df42160e43c1d620f9baef6539a9d87e16 /bfd
parentd5a3d0079373923fefb5f0680b7216a0003f4146 (diff)
downloadgdb-5016e13a8b701724c68f156b6292fada9878b968.tar.gz
* elflink.c (_bfd_elf_merge_symbol): Simplify.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elflink.c47
2 files changed, 13 insertions, 38 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index fb5e3647bde..dcb55735202 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2005-09-20 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.c (_bfd_elf_merge_symbol): Simplify.
+
2005-09-19 Alan Modra <amodra@bigpond.net.au>
* elf64-ppc.c (ppc_build_one_stub): Replace assertion that long
diff --git a/bfd/elflink.c b/bfd/elflink.c
index bf071a95d37..8ede25da6c2 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -852,55 +852,26 @@ _bfd_elf_merge_symbol (bfd *abfd,
/* NEWDYN and OLDDYN indicate whether the new or old symbol,
respectively, is from a dynamic object. */
- if ((abfd->flags & DYNAMIC) != 0)
- newdyn = TRUE;
- else
- newdyn = FALSE;
+ newdyn = (abfd->flags & DYNAMIC) != 0;
+ olddyn = FALSE;
if (oldbfd != NULL)
olddyn = (oldbfd->flags & DYNAMIC) != 0;
- else
+ else if (oldsec != NULL)
{
- asection *hsec;
-
- /* This code handles the special SHN_MIPS_{TEXT,DATA} section
+ /* This handles the special SHN_MIPS_{TEXT,DATA} section
indices used by MIPS ELF. */
- switch (h->root.type)
- {
- default:
- hsec = NULL;
- break;
-
- case bfd_link_hash_defined:
- case bfd_link_hash_defweak:
- hsec = h->root.u.def.section;
- break;
-
- case bfd_link_hash_common:
- hsec = h->root.u.c.p->section;
- break;
- }
-
- if (hsec == NULL)
- olddyn = FALSE;
- else
- olddyn = (hsec->symbol->flags & BSF_DYNAMIC) != 0;
+ olddyn = (oldsec->symbol->flags & BSF_DYNAMIC) != 0;
}
/* NEWDEF and OLDDEF indicate whether the new or old symbol,
respectively, appear to be a definition rather than reference. */
- if (bfd_is_und_section (sec) || bfd_is_com_section (sec))
- newdef = FALSE;
- else
- newdef = TRUE;
+ newdef = !bfd_is_und_section (sec) && !bfd_is_com_section (sec);
- if (h->root.type == bfd_link_hash_undefined
- || h->root.type == bfd_link_hash_undefweak
- || h->root.type == bfd_link_hash_common)
- olddef = FALSE;
- else
- olddef = TRUE;
+ olddef = (h->root.type != bfd_link_hash_undefined
+ && h->root.type != bfd_link_hash_undefweak
+ && h->root.type != bfd_link_hash_common);
/* Check TLS symbol. We don't check undefined symbol introduced by
"ld -u". */