]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
*-*-nacl* layout: Drop requirement that some section have SEC_HAS_CONTENTS set.
authorRoland McGrath <mcgrathr@google.com>
Fri, 1 Nov 2013 21:37:46 +0000 (14:37 -0700)
committerRoland McGrath <mcgrathr@google.com>
Fri, 1 Nov 2013 21:49:41 +0000 (14:49 -0700)
bfd/
* elf-nacl.c (segment_eligible_for_headers): Drop requirement that
some section have SEC_HAS_CONTENTS set.  It's not set for
.note.gnu.build-id, and a segment of only read-only SHT_NOBITS
sections is implausible and not really supportable anyway.

(cherry picked from commit 86e0565d9c985fa0ba46c85dbe6e77bcaf62dd33)

bfd/ChangeLog
bfd/elf-nacl.c

index 34ecf12c3f9affb18b13ada79c069c35c8041f00..e9a2f287e94cf89737f43c5643aaee0e1be40069 100644 (file)
@@ -1,3 +1,10 @@
+2013-11-01  Roland McGrath  <mcgrathr@google.com>
+
+       * elf-nacl.c (segment_eligible_for_headers): Drop requirement that
+       some section have SEC_HAS_CONTENTS set.  It's not set for
+       .note.gnu.build-id, and a segment of only read-only SHT_NOBITS
+       sections is implausible and not really supportable anyway.
+
 2013-10-29  Roland McGrath  <mcgrathr@google.com>
 
        * elf64-x86-64.c (elf_x86_64_nacl_plt0_entry): Correct 9-byte nop
index 5ec11616c42cee09a57b602b5042dffacf4b32be..c46b4cba3b91af6aac852b752e72a77f9d6f93ab 100644 (file)
@@ -44,14 +44,13 @@ segment_executable (struct elf_segment_map *seg)
 }
 
 /* Determine if this segment is eligible to receive the file and program
-   headers.  It must be read-only, non-executable, and have contents.
+   headers.  It must be read-only and non-executable.
    Its first section must start far enough past the page boundary to
    allow space for the headers.  */
 static bfd_boolean
 segment_eligible_for_headers (struct elf_segment_map *seg,
                              bfd_vma minpagesize, bfd_vma sizeof_headers)
 {
-  bfd_boolean any_contents = FALSE;
   unsigned int i;
   if (seg->count == 0 || seg->sections[0]->lma % minpagesize < sizeof_headers)
     return FALSE;
@@ -59,10 +58,8 @@ segment_eligible_for_headers (struct elf_segment_map *seg,
     {
       if ((seg->sections[i]->flags & (SEC_CODE|SEC_READONLY)) != SEC_READONLY)
        return FALSE;
-      if (seg->sections[i]->flags & SEC_HAS_CONTENTS)
-       any_contents = TRUE;
     }
-  return any_contents;
+  return TRUE;
 }