From 3a81e8251e18c6266f5b1c5147a9264da30fc5f0 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 26 Mar 2013 06:08:14 +0000 Subject: [PATCH] * elflink.c (elf_link_add_object_symbols): Add assertion for common override alignment check code. Formatting. --- bfd/ChangeLog | 5 +++++ bfd/elflink.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4a4b192e6c7..30e64ba3623 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2013-03-26 Alan Modra + + * elflink.c (elf_link_add_object_symbols): Add assertion for + common override alignment check code. Formatting. + 2013-03-25 Alan Modra * elflink.c (_bfd_elf_merge_symbol): Set old_alignment for diff --git a/bfd/elflink.c b/bfd/elflink.c index 792c47cfc5f..15909c205d5 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -4255,6 +4255,9 @@ error_free_dyn: bfd *normal_bfd; bfd *common_bfd; + BFD_ASSERT (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak); + symbol_align = ffs (h->root.u.def.value) - 1; if (h->root.u.def.section->owner != NULL && (h->root.u.def.section->owner->flags & DYNAMIC) == 0) @@ -4298,7 +4301,8 @@ error_free_dyn: } /* Remember the symbol size if it isn't undefined. */ - if ((isym->st_size != 0 && isym->st_shndx != SHN_UNDEF) + if (isym->st_size != 0 + && isym->st_shndx != SHN_UNDEF && (definition || h->size == 0)) { if (h->size != 0 -- 2.30.2