This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Overlay problem


On Wed, 24 Jan 2001, Jim Driftmyer wrote:

> I take it that the reason to
> use LDADDR vs. LMA_REGION is if you want to specify an address vs.
> letting the linker to automatically put things into a region?

Yes.  I guess there should be a check that only one of LDADDR and
LMA_REGION are specified, or really, that they don't conflict.

> A problem
> with the patch is that if a LDADDR is specified, the original error
> still occurs since a load region and absolute address are initialized. 

You're right.  I'll apply your patch.

ld/ChangeLog
2001-01-25  Jim Driftmyer <jdrift@stny.rr.com>

	* ldlang.c (lang_leave_overlay): Don't set lma_region when
	load_base is specified.

Alan Modra
-- 
Linuxcare.  Support for the Revolution.

Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.39
diff -u -p -r1.39 ldlang.c
--- ldlang.c	2001/01/23 11:48:28	1.39
+++ ldlang.c	2001/01/25 02:22:50
@@ -4782,8 +4782,12 @@ lang_leave_overlay (fill, memspec, phdrs
 	l->os->region = region;
       /* We only set lma_region for the first overlay section, as
 	 subsequent overlay sections will have load_base set relative
-	 to the first section.  */
-      if (lma_region != NULL && l->os->lma_region == NULL && l->next == NULL)
+	 to the first section.  Also, don't set lma_region if
+	 load_base is specified.  FIXME:  There should really be a test
+	 that `AT ( LDADDR )' doesn't conflict with `AT >LMA_REGION'
+	 rather than letting LDADDR simply override LMA_REGION.  */
+      if (lma_region != NULL && l->os->lma_region == NULL
+	  && l->next == NULL && l->os->load_base == NULL)
 	l->os->lma_region = lma_region;
       if (phdrs != NULL && l->os->phdrs == NULL)
 	l->os->phdrs = phdrs;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]