diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2003-07-26 01:06:27 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2003-07-26 01:06:27 +0000 |
commit | 3cddba1e54cbf32f53bebe904341dca542fb2a8c (patch) | |
tree | c3f77ca505740ad1d9f754ef69fc0cc78292cb6d /bfd | |
parent | a5de4c570e1b4df0598b2711f611ee28a8d6888b (diff) | |
download | gdb-3cddba1e54cbf32f53bebe904341dca542fb2a8c.zip gdb-3cddba1e54cbf32f53bebe904341dca542fb2a8c.tar.gz gdb-3cddba1e54cbf32f53bebe904341dca542fb2a8c.tar.bz2 |
bfd/
2003-07-25 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (_bfd_elf_new_section_hook): Set the default section
type to SHT_NULL.
(elf_fake_sections): Set the section type based on asect->flags
if it is SHT_NULL. Don't abort on processor specific section
types.
gas/
2003-07-25 H.J. Lu <hongjiu.lu@intel.com>
* config/obj-elf.c (obj_elf_change_section): Update
elf_section_type and elf_section_flags only when they are
specified.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/elf.c | 24 |
2 files changed, 21 insertions, 11 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 80fc0a5..aabf428 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,13 @@ 2003-07-25 H.J. Lu <hongjiu.lu@intel.com> + * elf.c (_bfd_elf_new_section_hook): Set the default section + type to SHT_NULL. + (elf_fake_sections): Set the section type based on asect->flags + if it is SHT_NULL. Don't abort on processor specific section + types. + +2003-07-25 H.J. Lu <hongjiu.lu@intel.com> + * bfd-in2.h: Regenerated. 2003-07-25 H.J. Lu <hongjiu.lu@intel.com> @@ -2293,12 +2293,7 @@ _bfd_elf_new_section_hook (abfd, sec) sec->used_by_bfd = (PTR) sdata; } - if ((sec->flags & SEC_ALLOC) != 0 - && (((sec->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) - || (sec->flags & SEC_NEVER_LOAD) != 0)) - elf_section_type (sec) = SHT_NOBITS; - else - elf_section_type (sec) = SHT_PROGBITS; + elf_section_type (sec) = SHT_NULL; if (sec->name && _bfd_elf_get_sec_type_attr (abfd, sec->name, &type, &attr)) { @@ -2544,14 +2539,21 @@ elf_fake_sections (abfd, asect, failedptrarg) this_hdr->bfd_section = asect; this_hdr->contents = NULL; + /* If the section type is unspecified, we set it based on + asect->flags. */ + if (this_hdr->sh_type == SHT_NULL) + { + if ((asect->flags & SEC_ALLOC) != 0 + && (((asect->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) + || (asect->flags & SEC_NEVER_LOAD) != 0)) + this_hdr->sh_type = SHT_NOBITS; + else + this_hdr->sh_type = SHT_PROGBITS; + } + switch (this_hdr->sh_type) { default: - (*_bfd_error_handler) - (_("%s: Section `%s' has unknown type 0x%0x"), - bfd_get_filename (asect->owner), asect->name, - this_hdr->sh_type); - abort (); break; case SHT_STRTAB: |