diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2005-05-02 14:00:16 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2005-05-02 14:00:16 +0000 |
commit | a31501e943401ca0a9af945cf73e78bc105de6bb (patch) | |
tree | 9bfe9b094af6ca8a996e50564b45a940a10a8bfd /bfd/elf.c | |
parent | d05da6a8c2e8a0ea893af11f68d195be0bccc668 (diff) | |
download | gdb-a31501e943401ca0a9af945cf73e78bc105de6bb.zip gdb-a31501e943401ca0a9af945cf73e78bc105de6bb.tar.gz gdb-a31501e943401ca0a9af945cf73e78bc105de6bb.tar.bz2 |
2005-05-02 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (_bfd_elf_new_section_hook): Don't call
_bfd_elf_get_sec_type_attr on sections from input files.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -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. */ |