* ldlang.c (lang_size_sections_1): Don't check LMA overflow on
	non-load sections.
ld/testsuite/
	* ld-scripts/rgn-over.exp: Allow -ok file names to pass.
	* ld-scripts/rgn-over8.s: New.
	* ld-scripts/rgn-over8.t: New.
	* ld-scripts/rgn-over8-ok.d: New.
This commit is contained in:
Nathan Sidwell 2008-04-28 12:45:34 +00:00
parent 417ed8af83
commit a2cab75396
7 changed files with 57 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2008-04-28 Nathan Sidwell <nathan@codesourcery.com>
* ldlang.c (lang_size_sections_1): Don't check LMA overflow on
non-load sections.
2008-04-25 Michael Frysinger <vapier@gentoo.org>
* configure.tgt (bfin-*-linux-uclibc*): Set targ_emul to elf32bfinfd

View File

@ -4699,7 +4699,8 @@ lang_size_sections_1
os_region_check (os, os->region, os->addr_tree,
os->bfd_section->vma);
if (os->lma_region != NULL && os->lma_region != os->region)
if (os->lma_region != NULL && os->lma_region != os->region
&& (os->bfd_section->flags & SEC_LOAD))
{
os->lma_region->current
= os->bfd_section->lma + TO_ADDR (os->bfd_section->size);

View File

@ -1,3 +1,10 @@
2008-04-28 Nathan Sidwell <nathan@codesourcery.com>
* ld-scripts/rgn-over.exp: Allow -ok file names to pass.
* ld-scripts/rgn-over8.s: New.
* ld-scripts/rgn-over8.t: New.
* ld-scripts/rgn-over8-ok.d: New.
2008-04-21 Nathan Sidwell <nathan@codesourcery.com>
* ld-vxworks/plt-mips1.s: New.

View File

@ -36,17 +36,19 @@ foreach test_file $test_list {
verbose $test_name
run_dump_test $test_name
set testname "[file tail $test_name] (map check)"
if [file exists $map_file] {
# compare the map file to the expectations in the .d file
# (run_dump_test can't do that).
if [regexp_diff $map_file $test_file] {
fail $testname
if { ! [regexp ".*-ok.d" $test_file] } {
set testname "[file tail $test_name] (map check)"
if [file exists $map_file] {
# compare the map file to the expectations in the .d file
# (run_dump_test can't do that).
if [regexp_diff $map_file $test_file] {
fail $testname
} else {
pass $testname
}
} else {
pass $testname
untested $testname
}
} else {
untested $testname
}
}
set LDFLAGS $old_ldflags

View File

@ -0,0 +1,12 @@
# name: rgn-over8
# source: rgn-over8.s
# ld: -T rgn-over8.t
# objdump: -w -h
.*: file format .*
Sections:
Idx +Name +Size +VMA +LMA +File off +Algn +Flags
0 .text 0+0000400 0+0000000 0+0000000 [0-9a-f]+ 2\*\*0 CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 0+0000400 0+0001000 0+0000400 [0-9a-f]+ 2\*\*0 CONTENTS, ALLOC, LOAD, DATA
2 .bss 0+0000400 0+0001400 0+0000800 [0-9a-f]+ 2\*\*0 ALLOC

View File

@ -0,0 +1,7 @@
.text
.globl main
.zero 1024
.data
.zero 1024
.bss
.zero 1024

View File

@ -0,0 +1,13 @@
/* Memory region overflow tests: bss to LMA doesn't cause overflow. */
MEMORY {
rom (rwx) : ORIGIN = 0, LENGTH = 2048
ram (rwx) : ORIGIN = 0x1000, LENGTH = 2048
}
_start = 0x0;
SECTIONS {
.text : { *(.text) } >rom AT>rom
.data : { *(.data) } >ram AT>rom
.bss : { *(.bss) } >ram AT>rom
/DISCARD/ : { *(*) }
}