diff options
author | Nick Clifton <nickc@redhat.com> | 2001-07-19 16:21:39 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2001-07-19 16:21:39 +0000 |
commit | 1545243be0f82ff8ce2007e69f54fb7f89a8f122 (patch) | |
tree | dac7e3a03dae97b515afbe34dda3ec2824ee32f8 /ld | |
parent | 1b577b00bda93731de384fefea094f3b78d96ee0 (diff) | |
download | gdb-1545243be0f82ff8ce2007e69f54fb7f89a8f122.zip gdb-1545243be0f82ff8ce2007e69f54fb7f89a8f122.tar.gz gdb-1545243be0f82ff8ce2007e69f54fb7f89a8f122.tar.bz2 |
If a region is specified assign it to all sections inside the overlay unless they have been assigned to the own, non-default, memory region.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 4 | ||||
-rw-r--r-- | ld/ldlang.c | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 108f63f..63368ac 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,9 @@ 2001-07-19 Nick Clifton <nickc@cambridge.redhat.com> + * ldlang.c (lang_leave_overlay): If a region is specified assign + it to all sections inside the overlay unless they have been + assigned to the own, non-default, memory region. + * README: Add header for consistency with other README files. 2001-07-14 H.J. Lu <hjl@gnu.org> diff --git a/ld/ldlang.c b/ld/ldlang.c index 2b88068..3f3c1fe 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -4818,10 +4818,13 @@ lang_leave_overlay (fill, memspec, phdrs, lma_memspec) const char *lma_memspec; { lang_memory_region_type *region; + lang_memory_region_type * default_region; lang_memory_region_type *lma_region; struct overlay_list *l; struct lang_nocrossref *nocrossref; + default_region = lang_memory_region_lookup ("*default*"); + if (memspec == NULL) region = NULL; else @@ -4841,8 +4844,15 @@ lang_leave_overlay (fill, memspec, phdrs, lma_memspec) if (fill != 0 && l->os->fill == 0) l->os->fill = fill; - if (region != NULL && l->os->region == NULL) + + /* Assign a region to the sections, if one has been specified. + Override the assignment of the default section, but not + other sections. */ + if (region != NULL && + (l->os->region == NULL || + l->os->region == default_region)) 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. Also, don't set lma_region if @@ -4852,6 +4862,7 @@ lang_leave_overlay (fill, memspec, phdrs, lma_memspec) 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; |