This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
[PATCH] Re: Link error with today's CVS binutils
- To: devolder at evsx dot com
- Subject: [PATCH] Re: Link error with today's CVS binutils
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Mon, 17 Jan 2000 18:25:17 -0800
- Cc: nickc at cygnus dot com, binutils at sourceware dot cygnus dot com
Nick,
Have you followed this thread? Your change:
1999-01-15 Nick Clifton <nickc@cygnus.com>
* ldlang.c (lang_size_sections): Only update the current
address of a region if the section just placed into it is an
allocated section.
seems to cause the regression. This patch seems to fix it. Any
comments?
Thanks.
--
H.J. Lu (hjl@gnu.org)
--
Mon Jan 17 18:22:20 PST H.J. Lu <hjl@gnu.org>
* ldlang.c (lang_size_sections): Also update the current
address of a region if the section raw size is > 0.
Index: ldlang.c
===================================================================
RCS file: /work/cvs/gnu/binutils/ld/ldlang.c,v
retrieving revision 1.1.1.13
diff -u -p -r1.1.1.13 ldlang.c
--- ldlang.c 2000/01/13 19:36:06 1.1.1.13
+++ ldlang.c 2000/01/18 02:20:33
@@ -2823,10 +2823,15 @@ lang_size_sections (s, output_section_st
/* Update dot in the region ?
We only do this if the section is going to be allocated,
since unallocated sections do not contribute to the region's
- overall size in memory. */
+ overall size in memory.
+
+ If the section raw size is > 0, it will affect the
+ addresses of sections after it. We have to update
+ dot. */
if (os->region != (lang_memory_region_type *) NULL
- && (bfd_get_section_flags (output_bfd, os->bfd_section)
- & (SEC_ALLOC | SEC_LOAD)))
+ && (os->bfd_section->_raw_size > 0
+ || (bfd_get_section_flags (output_bfd, os->bfd_section)
+ & (SEC_ALLOC | SEC_LOAD))))
{
os->region->current = dot;