* elf.c (bfd_section_from_shdr <default case>): Call
authorZack Weinberg <zackw@panix.com>
Wed, 2 Mar 2005 04:47:25 +0000 (04:47 +0000)
committerZack Weinberg <zackw@panix.com>
Wed, 2 Mar 2005 04:47:25 +0000 (04:47 +0000)
elf_backend_section_from_shdr hook unconditionally, and return
what it returns.
(bfd_section_from_phdr): Similarly, for elf_backend_section_from_phdr.
* elfxx-target.h (elf_backend_section_from_shdr)
(elf_backend_section_from_phdr): Default to
_bfd_elf_make_section_from_shdr and _bfd_elf_make_section_from_phdr
respectively.

bfd/ChangeLog
bfd/elf.c
bfd/elfxx-target.h

index 9bb0c9ec84d61fd8eb4a91ce67350c9456a3f9ab..ccc3c9e9c4d5d30b3d9c251aa9987d7bc9cf0515 100644 (file)
@@ -1,3 +1,14 @@
+2005-03-01  Zack Weinberg  <zack@codesourcery.com>
+
+       * elf.c (bfd_section_from_shdr <default case>): Call
+       elf_backend_section_from_shdr hook unconditionally, and return
+       what it returns.
+       (bfd_section_from_phdr): Similarly, for elf_backend_section_from_phdr.
+       * elfxx-target.h (elf_backend_section_from_shdr)
+       (elf_backend_section_from_phdr): Default to
+       _bfd_elf_make_section_from_shdr and _bfd_elf_make_section_from_phdr
+       respectively.
+
 2005-03-01  Alan Modra  <amodra@bigpond.net.au>
 
        * targets.h: Typo fix.
index 504f73584ec21c9cf72473b9319d002b44df3bfc..75f42edbc2ae1020e30d22a1bcfecccb49bbd783 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2039,9 +2039,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
 
     default:
       /* Check for any processor-specific section types.  */
-      if (bed->elf_backend_section_from_shdr)
-       (*bed->elf_backend_section_from_shdr) (abfd, hdr, name);
-      break;
+      return bed->elf_backend_section_from_shdr (abfd, hdr, name);
     }
 
   return TRUE;
@@ -2379,13 +2377,9 @@ bfd_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index)
       return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "relro");
 
     default:
-      /* Check for any processor-specific program segment types.
-         If no handler for them, default to making "segment" sections.  */
+      /* Check for any processor-specific program segment types.  */
       bed = get_elf_backend_data (abfd);
-      if (bed->elf_backend_section_from_phdr)
-       return (*bed->elf_backend_section_from_phdr) (abfd, hdr, index);
-      else
-       return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "segment");
+      return bed->elf_backend_section_from_phdr (abfd, hdr, index);
     }
 }
 
index 09b9eee438eeb94ac2e2e1a64dfbafb3e4d505d1..861cb2b274ad682735c98d7e2df4404b7cecc8b4 100644 (file)
 #define elf_backend_section_processing 0
 #endif
 #ifndef elf_backend_section_from_shdr
-#define elf_backend_section_from_shdr  0
+#define elf_backend_section_from_shdr  _bfd_elf_make_section_from_shdr
 #endif
 #ifndef elf_backend_section_flags
 #define elf_backend_section_flags      0
 #endif
 #ifndef elf_backend_section_from_phdr
-#define elf_backend_section_from_phdr  0
+#define elf_backend_section_from_phdr  _bfd_elf_make_section_from_phdr
 #endif
 #ifndef elf_backend_fake_sections
 #define elf_backend_fake_sections      0