aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2009-08-31 12:02:36 +0000
committerJan Beulich <jbeulich@novell.com>2009-08-31 12:02:36 +0000
commit94be91de018273a192f0aa60b1f40971d593e445 (patch)
treebbc9aba062007342a08d1e13e1bd370d3e11e01b /bfd
parentead0c8f37cc1979c316352bad6a6b7c510f8c40f (diff)
downloadgdb-94be91de018273a192f0aa60b1f40971d593e445.zip
gdb-94be91de018273a192f0aa60b1f40971d593e445.tar.gz
gdb-94be91de018273a192f0aa60b1f40971d593e445.tar.bz2
bfd/
2009-08-31 Jan Beulich <jbeulich@novell.com> * elf-bfd.h (bfd_elf_get_default_section_type): Declare. * elf.c (bfd_elf_get_default_section_type): New. (elf_fake_sections): Use bfd_elf_get_default_section_type. gas/ 2009-08-31 Jan Beulich <jbeulich@novell.com> * config/obj-elf.c (obj_elf_change_section): Set default type by calling bfd_elf_get_default_section_type. gas/testsuite/ 2009-08-31 Jan Beulich <jbeulich@novell.com> * gas/elf/section5.l: Remove no longer issued warning pattern.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf-bfd.h2
-rw-r--r--bfd/elf.c18
3 files changed, 21 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b29d850..8b51b17 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2009-08-31 Jan Beulich <jbeulich@novell.com>
+
+ * elf-bfd.h (bfd_elf_get_default_section_type): Declare.
+ * elf.c (bfd_elf_get_default_section_type): New.
+ (elf_fake_sections): Use bfd_elf_get_default_section_type.
+
2009-08-30 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_finish_dynamic_symbol): Revert the
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 8f70d79..7fbba61 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2108,6 +2108,8 @@ extern bfd_boolean _bfd_elf_map_sections_to_segments
extern bfd_boolean _bfd_elf_is_function_type (unsigned int);
+extern int bfd_elf_get_default_section_type (flagword);
+
extern Elf_Internal_Phdr * _bfd_elf_find_segment_containing_section
(bfd * abfd, asection * section);
diff --git a/bfd/elf.c b/bfd/elf.c
index 408cebd..13f6904 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2422,6 +2422,18 @@ _bfd_elf_init_reloc_shdr (bfd *abfd,
return TRUE;
}
+/* Return the default section type based on the passed in section flags. */
+
+int
+bfd_elf_get_default_section_type (flagword flags)
+{
+ if ((flags & SEC_ALLOC) != 0
+ && ((flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0
+ || (flags & SEC_NEVER_LOAD) != 0))
+ return SHT_NOBITS;
+ return SHT_PROGBITS;
+}
+
/* Set up an ELF internal section header for a section. */
static void
@@ -2471,12 +2483,8 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg)
asect->flags. */
if ((asect->flags & SEC_GROUP) != 0)
sh_type = SHT_GROUP;
- else if ((asect->flags & SEC_ALLOC) != 0
- && (((asect->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
- || (asect->flags & SEC_NEVER_LOAD) != 0))
- sh_type = SHT_NOBITS;
else
- sh_type = SHT_PROGBITS;
+ sh_type = bfd_elf_get_default_section_type (asect->flags);
if (this_hdr->sh_type == SHT_NULL)
this_hdr->sh_type = sh_type;