* [COMMITTED PATCH] *-*-nacl* layout: Drop requirement that some section have SEC_HAS_CONTENTS set.
@ 2013-11-01 21:53 Roland McGrath
0 siblings, 0 replies; only message in thread
From: Roland McGrath @ 2013-11-01 21:53 UTC (permalink / raw)
To: binutils
This check was useless for the imaginary case it was trying to handle, and
it broke a real case because an unfinished .note.gnu.build-id section does
not have SEC_HAS_CONTENTS set for some reason (despite its not being
destined to produce SHT_NOBITS).
Committed to trunk and 2.24 branch.
bfd/
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.
--- a/bfd/elf-nacl.c
+++ b/bfd/elf-nacl.c
@@ -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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-11-01 21:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-01 21:53 [COMMITTED PATCH] *-*-nacl* layout: Drop requirement that some section have SEC_HAS_CONTENTS set Roland McGrath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).