aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2002-02-12 09:25:39 +0000
committerAlexandre Oliva <aoliva@redhat.com>2002-02-12 09:25:39 +0000
commite948afafdb063530e11e3dce47da03deb3fd030d (patch)
treefc61b87e31d50bb2943510f57b1990713dda4f92
parent913572ec08c8b2eb59065bf92c1567cd430392be (diff)
downloadgdb-e948afafdb063530e11e3dce47da03deb3fd030d.zip
gdb-e948afafdb063530e11e3dce47da03deb3fd030d.tar.gz
gdb-e948afafdb063530e11e3dce47da03deb3fd030d.tar.bz2
* elf-m10300.c (mn10300_elf_relax_section): Skip section before
loading its contents if there's nothing to do in it.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf-m10300.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index bd3fc78..9b9cbac 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index fb94c51..e006ac2 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -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;