summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2008-10-08 08:30:25 +0000
committerAlan Modra <amodra@bigpond.net.au>2008-10-08 08:30:25 +0000
commitec5d68e31ad13796a382273623f9b0eb71094fe5 (patch)
tree14b479b7ef7e85e5de13984db08099c9967bb9ba
parentae02fca1a5202d81fb28aa1155831e075a141c15 (diff)
downloadgdb-ec5d68e31ad13796a382273623f9b0eb71094fe5.tar.gz
* elf.c (assign_file_positions_for_load_sections): When checking
a segment for contents, don't assume that a non-TLS nobits section must only be followed by nobits sections.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf.c23
2 files changed, 14 insertions, 15 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 031c67d58d8..d0b27f5509f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-08 Alan Modra <amodra@bigpond.net.au>
+
+ * elf.c (assign_file_positions_for_load_sections): When checking
+ a segment for contents, don't assume that a non-TLS nobits section
+ must only be followed by nobits sections.
+
2008-10-04 Hans-Peter Nilsson <hp@axis.com>
* elf32-cris.c (TLSHOWTO32, TLSHOWTO16): New macros.
diff --git a/bfd/elf.c b/bfd/elf.c
index e9d0af302a5..ea44f724661 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4288,21 +4288,14 @@ assign_file_positions_for_load_sections (bfd *abfd,
elf_section_type (m->sections[i]) = SHT_NOBITS;
/* Find out whether this segment contains any loadable
- sections. If the first section isn't loadable, the same
- holds for any other sections. */
- i = 0;
- while (elf_section_type (m->sections[i]) == SHT_NOBITS)
- {
- /* If a segment starts with .tbss, we need to look
- at the next section to decide whether the segment
- has any loadable sections. */
- if ((elf_section_flags (m->sections[i]) & SHF_TLS) == 0
- || ++i >= m->count)
- {
- no_contents = TRUE;
- break;
- }
- }
+ sections. */
+ no_contents = TRUE;
+ for (i = 0; i < m->count; i++)
+ if (elf_section_type (m->sections[i]) != SHT_NOBITS)
+ {
+ no_contents = FALSE;
+ break;
+ }
off_adjust = vma_page_aligned_bias (m->sections[0]->vma, off, align);
off += off_adjust;