diff options
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/elf.c | 2 | ||||
-rw-r--r-- | bfd/linker.c | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8a073f6..1396c70 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,13 @@ 2018-12-28 Alan Modra <amodra@gmail.com> + PR 24015 + * elf.c (bfd_elf_get_default_section_type): Make common sections + SHT_NOBITS. + * linker.c (bfd_generic_define_common_symbol): Clear + SEC_HAS_CONTENTS. + +2018-12-28 Alan Modra <amodra@gmail.com> + PR 23966 * libbfd.c (SSIZE_MAX): Define. (bfd_malloc, bfd_realloc): Don't cast size to long to check for @@ -3127,7 +3127,7 @@ _bfd_elf_init_reloc_shdr (bfd *abfd, int bfd_elf_get_default_section_type (flagword flags) { - if ((flags & SEC_ALLOC) != 0 + if ((flags & (SEC_ALLOC | SEC_IS_COMMON)) != 0 && (flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) return SHT_NOBITS; return SHT_PROGBITS; diff --git a/bfd/linker.c b/bfd/linker.c index 9fee90d..fff9d9b 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -3119,7 +3119,7 @@ bfd_generic_define_common_symbol (bfd *output_bfd, /* Make sure the section is allocated in memory, and make sure that it is no longer a common section. */ section->flags |= SEC_ALLOC; - section->flags &= ~SEC_IS_COMMON; + section->flags &= ~(SEC_IS_COMMON | SEC_HAS_CONTENTS); return TRUE; } |