* ld-scripts/crossref.exp: Compile test source with -mtiny=0 in order to
[deliverable/binutils-gdb.git] / ld / ldwrite.c
index ee9d74a796d6c5a00203ede07f17ae774800aab1..0f45a916059183e6547dc658c94d5abc326506c5 100644 (file)
@@ -1,26 +1,27 @@
 /* ldwrite.c -- write out the linked file
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002,
-   2003, 2004, 2005 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    Written by Steve Chamberlain sac@cygnus.com
 
-This file is part of GLD, the Gnu Linker.
+   This file is part of the GNU Binutils.
 
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
-#include "bfd.h"
 #include "sysdep.h"
+#include "bfd.h"
 #include "bfdlink.h"
 #include "libiberty.h"
 #include "safe-ctype.h"
@@ -269,7 +270,10 @@ build_link_order (lang_statement_union_type *statement)
        output_section = statement->padding_statement.output_section;
        ASSERT (statement->padding_statement.output_section->owner
                == output_bfd);
-       if ((output_section->flags & SEC_HAS_CONTENTS) != 0)
+       if (((output_section->flags & SEC_HAS_CONTENTS) != 0
+            || ((output_section->flags & SEC_LOAD) != 0
+                && (output_section->flags & SEC_THREAD_LOCAL)))
+           && (output_section->flags & SEC_NEVER_LOAD) == 0)
          {
            link_order = bfd_new_link_order (output_bfd, output_section);
            link_order->type = bfd_data_link_order;
@@ -293,7 +297,7 @@ build_link_order (lang_statement_union_type *statement)
 static bfd_boolean
 unsplittable_name (const char *name)
 {
-  if (strncmp (name, ".stab", 5) == 0)
+  if (CONST_STRNEQ (name, ".stab"))
     {
       /* There are several stab like string sections. We pattern match on
         ".stab...str"  */
@@ -338,7 +342,7 @@ clone_section (bfd *abfd, asection *s, const char *name, int *count)
     {
       /* Some section names cannot be truncated, as the name is
         used to locate some other section.  */
-      if (strncmp (name, ".stab", 5) == 0
+      if (CONST_STRNEQ (name, ".stab")
          || strcmp (name, "$GDB_SYMBOLS$") == 0)
        {
          einfo (_ ("%F%P: cannot create split section name for %s\n"), name);
This page took 0.023605 seconds and 4 git commands to generate.