* elf-m10300.c (mn10300_elf_relax_section): Skip section before
authorAlexandre Oliva <aoliva@redhat.com>
Tue, 12 Feb 2002 09:25:39 +0000 (09:25 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Tue, 12 Feb 2002 09:25:39 +0000 (09:25 +0000)
loading its contents if there's nothing to do in it.

bfd/ChangeLog
bfd/elf-m10300.c

index bd3fc783f3855a1d39cb8749b59928267a511e0b..9b9cbacf06d9cac05dc8641f1c0086070e98866c 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-12  Alexandre Oliva  <aoliva@redhat.com>
+
+       * elf-m10300.c (mn10300_elf_relax_section): Skip section before
+       loading its contents if there's nothing to do in it.
+
 2002-02-12  Alan Modra  <amodra@bigpond.net.au>
 
        * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing
index fb94c5127adb6a70904c73d824e8179ea9581233..e006ac2581b47866dfdd3ca58e1f6354e6f5d1e8 100644 (file)
@@ -1,5 +1,5 @@
 /* Matsushita 10300 specific support for 32-bit ELF
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -874,6 +874,12 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
              const char *sym_name;
              char *new_name;
 
+             /* If there's nothing to do in this section, skip it.  */
+             if (! (((section->flags & SEC_RELOC) != 0
+                     && section->reloc_count != 0)
+                    || (section->flags & SEC_CODE) != 0))
+               continue;
+
              /* Get cached copy of section contents if it exists.  */
              if (elf_section_data (section)->this_hdr.contents != NULL)
                contents = elf_section_data (section)->this_hdr.contents;