This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Overlap error not generated for sections w/o content
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 16 Jan 2008 11:57:23 +1030
- Subject: Re: Overlap error not generated for sections w/o content
- References: <40015A34.2B3AFA5C@nsc.com> <20040112011235.GD11283@bubble.modra.org> <m3hdz18fbl.fsf@redhat.com>
Re: http://sourceware.org/ml/binutils/2004-01/msg00179.html
I was looking at this code the other day, and puzzled for a while over
why we want to test output_section_statement->flags & SEC_ALLOC here.
I figure it's just there to save an unnecessary write to memory, but
the "flags" are different so it isn't obviously correct.
* ldlang.c (lang_size_sections_1): Simplify SEC_NEVER_LOAD test.
Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.277
diff -u -p -r1.277 ldlang.c
--- ld/ldlang.c 16 Jan 2008 00:31:18 -0000 1.277
+++ ld/ldlang.c 16 Jan 2008 00:34:45 -0000
@@ -4702,8 +4702,7 @@ lang_size_sections_1
should have space allocated to it, unless the
user has explicitly stated that the section
should never be loaded. */
- if (!(output_section_statement->flags
- & (SEC_NEVER_LOAD | SEC_ALLOC)))
+ if (!(output_section_statement->flags & SEC_NEVER_LOAD))
output_section_statement->bfd_section->flags |= SEC_ALLOC;
}
dot = newdot;
--
Alan Modra
Australia Development Lab, IBM