Browse Source
(is_elf_format): New, extracted from... * ld-scripts/weak.exp: ...here. * ld-scripts/overlay-size.exp: New test. * ld-scripts/overlay-size.[tsd], * ld-scripts/overlay-size-map.d: New files for it.binutils-2_13-branch
8 changed files with 203 additions and 14 deletions
@ -0,0 +1,23 @@ |
|||
#... |
|||
\.bss1 *0x0*20000 *0x10 |
|||
#... |
|||
\.bss2 *0x0*20000 *0x30 load address 0x0*20010 |
|||
#... |
|||
\.bss3 *0x0*20000 *0x20 load address 0x0*20040 |
|||
#... |
|||
\.mtext *0x0*10000 *0x20 load address 0x0*30000 |
|||
#... |
|||
\.mbss *0x0*20030 *0x230 load address 0x0*20060 |
|||
#... |
|||
\.text1 *0x0*10020 *0x80 load address 0x0*30020 |
|||
#... |
|||
\.text2 *0x0*10020 *0x40 load address 0x0*300a0 |
|||
#... |
|||
\.text3 *0x0*10020 *0x20 load address 0x0*300e0 |
|||
#... |
|||
\.data1 *0x0*20260 *0x30 load address 0x0*30100 |
|||
#... |
|||
\.data2 *0x0*20260 *0x40 load address 0x0*30130 |
|||
#... |
|||
\.data3 *0x0*20260 *0x50 load address 0x0*30170 |
|||
#pass |
|||
@ -0,0 +1,29 @@ |
|||
# ld: -T overlay-size.t -Map tmpdir/overlay-size.map |
|||
# name: overlay size |
|||
# objdump: --headers |
|||
# |
|||
# The .bss[123] LMAs are deliberately blanked out. We can't |
|||
# reliably map overlaid sections to segments. |
|||
#... |
|||
0 \.bss1 +0+010 +0+20000 .* |
|||
#... |
|||
1 \.bss2 +0+030 +0+20000 .* |
|||
#... |
|||
2 \.bss3 +0+020 +0+20000 .* |
|||
#... |
|||
3 \.mtext +0+020 +0+10000 +0+30000 .* |
|||
#... |
|||
4 \.mbss +0+230 +0+20030 +0+20060 .* |
|||
#... |
|||
5 \.text1 +0+080 +0+10020 +0+30020 .* |
|||
#... |
|||
6 \.text2 +0+040 +0+10020 +0+300a0 .* |
|||
#... |
|||
7 \.text3 +0+020 +0+10020 +0+300e0 .* |
|||
#... |
|||
8 \.data1 +0+030 +0+20260 +0+30100 .* |
|||
#... |
|||
9 \.data2 +0+040 +0+20260 +0+30130 .* |
|||
#... |
|||
10 \.data3 +0+050 +0+20260 +0+30170 .* |
|||
#pass |
|||
@ -0,0 +1,31 @@ |
|||
# Test the OVERLAY statement. |
|||
# Copyright 2002 Free Software Foundation, Inc. |
|||
# |
|||
# This file is free software; you can redistribute it and/or modify |
|||
# it under the terms of the GNU General Public License as published by |
|||
# the Free Software Foundation; either version 2 of the License, or |
|||
# (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU General Public License |
|||
# along with this program; if not, write to the Free Software |
|||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|||
|
|||
if ![is_elf_format] { |
|||
return |
|||
} |
|||
|
|||
run_dump_test overlay-size |
|||
|
|||
set testname "overlay size (map check)" |
|||
|
|||
if [regexp_diff "tmpdir/overlay-size.map" \ |
|||
"$srcdir/$subdir/overlay-size-map.d"] { |
|||
fail $testname |
|||
} else { |
|||
pass $testname |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
.section .bss1, "aw", "nobits" |
|||
.space 0x10 |
|||
.section .bss2, "aw", "nobits" |
|||
.space 0x30 |
|||
.section .bss3, "aw", "nobits" |
|||
.space 0x20 |
|||
|
|||
.section .text1, "ax", "progbits" |
|||
.space 0x80 |
|||
.section .text2, "ax", "progbits" |
|||
.space 0x40 |
|||
.section .text3, "ax", "progbits" |
|||
.space 0x20 |
|||
|
|||
.section .data1, "aw", "progbits" |
|||
.space 0x30 |
|||
.section .data2, "aw", "progbits" |
|||
.space 0x40 |
|||
.section .data3, "aw", "progbits" |
|||
.space 0x50 |
|||
|
|||
.section .mtext, "ax", "progbits" |
|||
.space 0x20 |
|||
.section .mbss, "aw", "nobits" |
|||
.space 0x30 |
|||
@ -0,0 +1,57 @@ |
|||
MEMORY |
|||
{ |
|||
TEXTMEM (ARX) : ORIGIN = 0x10000, LENGTH = 32K |
|||
DATAMEM (AW) : ORIGIN = 0x20000, LENGTH = 32K |
|||
LOADMEM (AW) : ORIGIN = 0x30000, LENGTH = 32K |
|||
} |
|||
|
|||
/* Map should be: |
|||
|
|||
SIZE VMA LMA |
|||
.bss1 10 20000 20000 |
|||
.bss2 30 20000 20010 |
|||
.bss3 20 20000 20040 |
|||
.mbss 230 20030 20060 |
|||
|
|||
.mtext 20 10000 30000 |
|||
.text1 80 10020 30020 |
|||
.text2 40 10020 300a0 |
|||
.text3 20 10020 300e0 |
|||
|
|||
.data1 30 20260 30100 |
|||
.data2 40 20260 30130 |
|||
.data3 50 20260 30170 */ |
|||
|
|||
SECTIONS |
|||
{ |
|||
OVERLAY : |
|||
{ |
|||
.bss1 { *(.bss1) } |
|||
.bss2 { *(.bss2) } |
|||
.bss3 { *(.bss3) } |
|||
} > DATAMEM |
|||
|
|||
.mtext : { *(.mtext) } > TEXTMEM AT > LOADMEM |
|||
|
|||
.mbss : AT (__load_stop_bss3) |
|||
{ |
|||
*(.mbss) |
|||
. += 0x200; |
|||
} > DATAMEM |
|||
|
|||
OVERLAY : |
|||
{ |
|||
.text1 { *(.text1) } |
|||
.text2 { *(.text2) } |
|||
.text3 { *(.text3) } |
|||
} > TEXTMEM AT > LOADMEM |
|||
|
|||
OVERLAY : |
|||
{ |
|||
.data1 { *(.data1) } |
|||
.data2 { *(.data2) } |
|||
.data3 { *(.data3) } |
|||
} > DATAMEM AT > LOADMEM |
|||
|
|||
. = 0x8000; |
|||
} |
|||
Loading…
Reference in new issue