Drop SEC_HAS_CONTENTS condition from section classification for NaCl layout
This check causes it to refuse an RODATA segment that contains nothing
but .note.gnu.build-id. The check only ever served to identify a
segment of nothing but read-only SHT_NOBITS sections, which never
happens in practice and would break things in other ways if it did.
BUG= none
TEST= manual
R=sehr@chromium.org
Review URL: https://codereview.chromium.org/56023003
diff --git a/bfd/elf-nacl.c b/bfd/elf-nacl.c
index c8fd7aa..e0d6ea9 100644
--- a/bfd/elf-nacl.c
+++ b/bfd/elf-nacl.c
@@ -44,14 +44,13 @@
}
/* 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 @@
{
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;
}