From a31501e943401ca0a9af945cf73e78bc105de6bb Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 2 May 2005 14:00:16 +0000 Subject: 2005-05-02 H.J. Lu * elf.c (_bfd_elf_new_section_hook): Don't call _bfd_elf_get_sec_type_attr on sections from input files. --- bfd/ChangeLog | 5 +++++ bfd/elf.c | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e9925a6..f4c8450 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2005-05-02 H.J. Lu + * elf.c (_bfd_elf_new_section_hook): Don't call + _bfd_elf_get_sec_type_attr on sections from input files. + +2005-05-02 H.J. Lu + * merge.c (sec_merge_init): Call bfd_hash_table_init_n with hash table size 16699 instead of bfd_hash_table_init. diff --git a/bfd/elf.c b/bfd/elf.c index ba66cd4..2af5a89 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -2245,12 +2245,17 @@ _bfd_elf_new_section_hook (bfd *abfd, asection *sec) sec->used_by_bfd = sdata; } - elf_section_type (sec) = SHT_NULL; - ssect = _bfd_elf_get_sec_type_attr (abfd, sec->name); - if (ssect != NULL) + /* 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) { - elf_section_type (sec) = ssect->type; - elf_section_flags (sec) = ssect->attr; + ssect = _bfd_elf_get_sec_type_attr (abfd, sec->name); + if (ssect != NULL) + { + elf_section_type (sec) = ssect->type; + elf_section_flags (sec) = ssect->attr; + } } /* Indicate whether or not this section should use RELA relocations. */ -- cgit v1.1