aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2008-04-28 12:45:34 +0000
committerNathan Sidwell <nathan@codesourcery.com>2008-04-28 12:45:34 +0000
commita2cab75396adb33c5e660c37048151fb6732a040 (patch)
tree30ff0b918fc0e2f7bde0dc9671d5948bf7605ff7 /ld
parent417ed8af836c10ff5c0cbcdc4c011f5024a7269b (diff)
downloadgdb-a2cab75396adb33c5e660c37048151fb6732a040.zip
gdb-a2cab75396adb33c5e660c37048151fb6732a040.tar.gz
gdb-a2cab75396adb33c5e660c37048151fb6732a040.tar.bz2
ld/
* 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.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldlang.c3
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-scripts/rgn-over.exp20
-rw-r--r--ld/testsuite/ld-scripts/rgn-over8-ok.d12
-rw-r--r--ld/testsuite/ld-scripts/rgn-over8.s7
-rw-r--r--ld/testsuite/ld-scripts/rgn-over8.t13
7 files changed, 57 insertions, 10 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 33899e5..16c2169 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -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
diff --git a/ld/ldlang.c b/ld/ldlang.c
index cbf46fc..3c24b66 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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);
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index b2d61e0..6374667 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -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.
diff --git a/ld/testsuite/ld-scripts/rgn-over.exp b/ld/testsuite/ld-scripts/rgn-over.exp
index 509f7ff..05a7071 100644
--- a/ld/testsuite/ld-scripts/rgn-over.exp
+++ b/ld/testsuite/ld-scripts/rgn-over.exp
@@ -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
diff --git a/ld/testsuite/ld-scripts/rgn-over8-ok.d b/ld/testsuite/ld-scripts/rgn-over8-ok.d
new file mode 100644
index 0000000..dda54aa
--- /dev/null
+++ b/ld/testsuite/ld-scripts/rgn-over8-ok.d
@@ -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
diff --git a/ld/testsuite/ld-scripts/rgn-over8.s b/ld/testsuite/ld-scripts/rgn-over8.s
new file mode 100644
index 0000000..b80510d
--- /dev/null
+++ b/ld/testsuite/ld-scripts/rgn-over8.s
@@ -0,0 +1,7 @@
+ .text
+ .globl main
+ .zero 1024
+ .data
+ .zero 1024
+ .bss
+ .zero 1024
diff --git a/ld/testsuite/ld-scripts/rgn-over8.t b/ld/testsuite/ld-scripts/rgn-over8.t
new file mode 100644
index 0000000..7623b19
--- /dev/null
+++ b/ld/testsuite/ld-scripts/rgn-over8.t
@@ -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/ : { *(*) }
+}