* 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.
This commit is contained in:
parent
99164030b9
commit
f77c394825
6 changed files with 58 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2010-03-15 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* ldlang.c (lang_insert_orphan): Place loadable orphans in the same
|
||||
region and phdrs as their placement section.
|
||||
|
||||
2010-03-15 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* emultempl/ppc64elf.em (move_input_section, sort_toc_sections): New.
|
||||
|
|
15
ld/ldlang.c
15
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')
|
||||
{
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2010-03-15 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* ld-elf/orphan-region.d, ld-elf/orphan-region.ld,
|
||||
ld-elf/orphan-region.s: New files.
|
||||
|
||||
2010-03-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
|
||||
|
||||
* ld-arm/arm-merge-incompatible.d: New test.
|
||||
|
|
16
ld/testsuite/ld-elf/orphan-region.d
Normal file
16
ld/testsuite/ld-elf/orphan-region.d
Normal file
|
@ -0,0 +1,16 @@
|
|||
#source: orphan-region.s
|
||||
#ld: -T orphan-region.ld
|
||||
#readelf: -S -l --wide
|
||||
|
||||
#...
|
||||
\[[ 0-9]+\] \.text[ \t]+PROGBITS[ \t]+0*40000000[ \t]+.*
|
||||
\[[ 0-9]+\] \.rodata[ \t]+PROGBITS[ \t]+0*400000[0-9a-f]+[ \t]+.*
|
||||
\[[ 0-9]+\] \.moredata[ \t]+PROGBITS[ \t]+0*400000[0-9a-f]+[ \t]+.*
|
||||
#...
|
||||
Program Headers:
|
||||
Type.*
|
||||
LOAD[ \t]+0x[0-9a-f]+ 0x0*40000000 0x0*40000000 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x[0-9a-f]+
|
||||
|
||||
Section to Segment mapping:
|
||||
Segment Sections...
|
||||
00 .text .rodata .moredata *
|
10
ld/testsuite/ld-elf/orphan-region.ld
Normal file
10
ld/testsuite/ld-elf/orphan-region.ld
Normal file
|
@ -0,0 +1,10 @@
|
|||
MEMORY
|
||||
{
|
||||
region : ORIGIN = 0x40000000, LENGTH = 8M
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text : ALIGN (4) { *(.text) } > region
|
||||
.rodata : ALIGN (4) { *(.rodata) } > region
|
||||
}
|
8
ld/testsuite/ld-elf/orphan-region.s
Normal file
8
ld/testsuite/ld-elf/orphan-region.s
Normal file
|
@ -0,0 +1,8 @@
|
|||
.text
|
||||
.long 0
|
||||
.section ".rodata", "a", %progbits
|
||||
.long 0
|
||||
.section ".moredata", "a", %progbits
|
||||
.long 0
|
||||
.section ".notdata", "", %progbits
|
||||
.long 0
|
Loading…
Reference in a new issue