From c1eb148815418b80717c0abcba633c6cfc098133 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 23 Jan 2001 11:48:28 +0000 Subject: [PATCH] Only set lma_region from the default for the first section of a group of overlay sections. --- ld/ChangeLog | 5 +++++ ld/ldlang.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 49ec5e4140d..15f683c9f98 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2001-01-23 Alan Modra + + * ldlang.c (lang_leave_overlay): Only set lma_region from the + default for the first section of a group of overlay sections. + 2001-01-22 Alan Modra * Makefile.am (GENSCRIPTS): Pass exec_prefix. diff --git a/ld/ldlang.c b/ld/ldlang.c index bc25f045740..2baf13b85df 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -4780,7 +4780,10 @@ lang_leave_overlay (fill, memspec, phdrs, lma_memspec) l->os->fill = fill; if (region != NULL && l->os->region == NULL) l->os->region = region; - if (lma_region != NULL && l->os->lma_region == NULL) + /* 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) l->os->lma_region = lma_region; if (phdrs != NULL && l->os->phdrs == NULL) l->os->phdrs = phdrs; -- 2.30.2