aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2010-03-16 14:14:40 +0000
committerDaniel Jacobowitz <drow@false.org>2010-03-16 14:14:40 +0000
commitf77c3948254d0653c6957562cba846107dcb6d89 (patch)
tree1dfb5859f3769445a4327ce4df66df120775026e /ld/ldlang.c
parent99164030b983b819ff55debcd0c7d9e2d91e84ee (diff)
downloadgdb-f77c3948254d0653c6957562cba846107dcb6d89.zip
gdb-f77c3948254d0653c6957562cba846107dcb6d89.tar.gz
gdb-f77c3948254d0653c6957562cba846107dcb6d89.tar.bz2
* ldlang.c (lang_insert_orphan): Place loadable orphans in the same
region and phdrs as their placement section. testsuite/ * ld-elf/orphan-region.d, ld-elf/orphan-region.ld, ld-elf/orphan-region.s: New files.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 913f2b2..3d316c5 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1761,7 +1761,20 @@ lang_insert_orphan (asection *s,
add_child = &os->children;
lang_add_section (add_child, s, os);
- lang_leave_output_section_statement (0, "*default*", NULL, NULL);
+ if (after && (s->flags & (SEC_LOAD | SEC_ALLOC)) != 0)
+ {
+ const char *region = (after->region
+ ? after->region->name_list.name
+ : DEFAULT_MEMORY_REGION);
+ const char *lma_region = (after->lma_region
+ ? after->lma_region->name_list.name
+ : NULL);
+ lang_leave_output_section_statement (NULL, region, after->phdrs,
+ lma_region);
+ }
+ else
+ lang_leave_output_section_statement (NULL, DEFAULT_MEMORY_REGION, NULL,
+ NULL);
if (ps != NULL && *ps == '\0')
{