Ignore data-only sections when checking interworking status
[deliverable/binutils-gdb.git] / bfd / elf32-arm.h
index 7c284c1747468d1e431a8cdec344bc492f8d0eb4..f8c859f764ab80426a57799ecb7295208ddca520 100644 (file)
@@ -1,5 +1,6 @@
 /* 32-bit ELF support for ARM
-   Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -2430,11 +2431,16 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd)
      not, its flags may not have been initialised either, but it
      cannot actually cause any incompatibility.  Do not short-circuit
      dynamic objects; their section list may be emptied by
-     elf_link_add_object_symbols.  */
+    elf_link_add_object_symbols.
 
+    Also check to see if there are no code sections in the input.
+    In this case there is no need to check for code specific flags.
+    XXX - do we need to worry about floating-point format compatability
+    in data sections ?  */
   if (!(ibfd->flags & DYNAMIC))
     {
       bfd_boolean null_input_bfd = TRUE;
+      bfd_boolean only_data_sections = TRUE;
 
       for (sec = ibfd->sections; sec != NULL; sec = sec->next)
        {
@@ -2442,11 +2448,17 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd)
          if (strcmp (sec->name, ".glue_7")
              && strcmp (sec->name, ".glue_7t"))
            {
+             if ((bfd_get_section_flags (ibfd, sec)
+                  & (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
+                 == (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
+               only_data_sections = FALSE;
+
              null_input_bfd = FALSE;
              break;
            }
        }
-      if (null_input_bfd)
+
+      if (null_input_bfd || only_data_sections)
        return TRUE;
     }
 
This page took 0.02353 seconds and 4 git commands to generate.