summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2007-02-12 11:14:01 +0000
committerAlan Modra <amodra@bigpond.net.au>2007-02-12 11:14:01 +0000
commit75a979a6dbe1a6e0bb66af0eec5bccfe3f81f6d8 (patch)
tree23daa1e4e0ba4800e387f882ee276cb6207f6f60
parent62050c3a3ec68c21f71359ed5b24de3305646c42 (diff)
downloadgdb-75a979a6dbe1a6e0bb66af0eec5bccfe3f81f6d8.tar.gz
* elflink.c (bfd_elf_discard_info): Tidy setting of "eh".
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elflink.c15
2 files changed, 13 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 3c64c6a11eb..5dcf47be343 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2007-02-12 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.c (bfd_elf_discard_info): Tidy setting of "eh".
+
2007-02-05 Dave Brolley <brolley@redhat.com>
Stan Cox <scox@redhat.com>
diff --git a/bfd/elflink.c b/bfd/elflink.c
index b4dfcebae91..0b4064189fb 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1,6 +1,6 @@
/* ELF linking support for BFD.
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006 Free Software Foundation, Inc.
+ 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -10938,12 +10938,15 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
if ((abfd->flags & DYNAMIC) != 0)
continue;
- eh = bfd_get_section_by_name (abfd, ".eh_frame");
- if (info->relocatable
- || (eh != NULL
+ eh = NULL;
+ if (!info->relocatable)
+ {
+ eh = bfd_get_section_by_name (abfd, ".eh_frame");
+ if (eh != NULL
&& (eh->size == 0
- || bfd_is_abs_section (eh->output_section))))
- eh = NULL;
+ || bfd_is_abs_section (eh->output_section)))
+ eh = NULL;
+ }
stab = bfd_get_section_by_name (abfd, ".stab");
if (stab != NULL