This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
overlays with last section empty
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sourceware dot org
- Date: Fri, 13 Jul 2007 16:54:17 +0930
- Subject: overlays with last section empty
Stripping empty sections interacts badly with overlay handling. The
last section of an overlay arranges to set "dot" just past the end of
the largest overlay. If this section is not processed, "dot" remains
at the start of the overlay region.
* ldlang.c (strip_excluded_output_sections): Don't ignore sections
with update_dot_tree.
Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.266
diff -u -p -r1.266 ldlang.c
--- ld/ldlang.c 12 Jul 2007 01:40:25 -0000 1.266
+++ ld/ldlang.c 13 Jul 2007 07:17:15 -0000
@@ -3380,7 +3380,8 @@ strip_excluded_output_sections (void)
{
/* We don't set bfd_section to NULL since bfd_section of the
removed output section statement may still be used. */
- if (!os->section_relative_symbol)
+ if (!os->section_relative_symbol
+ && !os->update_dot_tree)
os->ignored = TRUE;
output_section->flags |= SEC_EXCLUDE;
bfd_section_list_remove (output_bfd, output_section);
--
Alan Modra
Australia Development Lab, IBM