diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elflink.c | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5d04571..3ed2e9e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2017-08-07 H.J. Lu <hongjiu.lu@intel.com> + + * elflink.c (elf_link_add_object_symbols): Move common symbol + check after bed->common_definition. + 2017-08-07 Alan Modra <amodra@gmail.com> PR 21910 diff --git a/bfd/elflink.c b/bfd/elflink.c index b89d537..424de21 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -4250,15 +4250,16 @@ error_free_dyn: override = FALSE; - /* Treat common symbol as undefined for --no-define-common. */ - if (isym->st_shndx == SHN_COMMON - && info->inhibit_common_definition) - isym->st_shndx = SHN_UNDEF; - flags = BSF_NO_FLAGS; sec = NULL; value = isym->st_value; common = bed->common_definition (isym); + if (common && info->inhibit_common_definition) + { + /* Treat common symbol as undefined for --no-define-common. */ + isym->st_shndx = SHN_UNDEF; + common = FALSE; + } discarded = FALSE; bind = ELF_ST_BIND (isym->st_info); |