aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 5477ba6..6ba2cb8 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2245,10 +2245,11 @@ _bfd_elf_new_section_hook (bfd *abfd, asection *sec)
sec->used_by_bfd = sdata;
}
- /* When we read a file, we don't need section type and flags.
- They will be overridden in _bfd_elf_make_section_from_shdr
- anyway. */
- if (abfd->direction != read_direction)
+ /* When we read a file, we don't need section type and flags unless
+ it is a linker created section. They will be overridden in
+ _bfd_elf_make_section_from_shdr anyway. */
+ if (abfd->direction != read_direction
+ || (sec->flags & SEC_LINKER_CREATED) != 0)
{
ssect = _bfd_elf_get_sec_type_attr (abfd, sec->name);
if (ssect != NULL)