This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
segment overflow test
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: binutils <binutils at sources dot redhat dot com>
- Date: Wed, 19 Dec 2007 10:23:03 +0000
- Subject: segment overflow test
I've added this testcase to make sure we don't regress on my recent patch to
segment checking:
2007-11-28 Nathan Sidwell <nathan@codesourcery.com>
* internal.h (ELF_IS_SECTION_IN_SEGMENT): Adjust to cope with
segments at the end of memory.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
2007-12-19 Nathan Sidwell <nathan@codesourcery.com>
* ld-elf/seg.t: New.
* ld-elf/seg.d: New.
* ld-elf/seg.s: New.
Index: ld-elf/seg.d
===================================================================
RCS file: ld-elf/seg.d
diff -N ld-elf/seg.d
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- ld-elf/seg.d 19 Dec 2007 10:20:40 -0000
***************
*** 0 ****
--- 1,14 ----
+ #source: seg.s
+ #ld: -T seg.t -z max-page-size=0x1000
+ #readelf: -l --wide
+
+ #...
+ Program Headers:
+ Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
+ LOAD .*
+ LOAD 0x0*001000 0xf*fffff000 0xf*fffff000 0x01000 0x01000 .*
+
+ Section to Segment mapping:
+ Segment Sections...
+ 00 .*
+ 01 reset boot
Index: ld-elf/seg.s
===================================================================
RCS file: ld-elf/seg.s
diff -N ld-elf/seg.s
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- ld-elf/seg.s 19 Dec 2007 10:20:40 -0000
***************
*** 0 ****
--- 1,6 ----
+ .section boot,"ax"
+ .4byte 0x76543210
+ .section reset,"ax"
+ .4byte 0xfedcba98
+ .text
+ .4byte 0x12345678
Index: ld-elf/seg.t
===================================================================
RCS file: ld-elf/seg.t
diff -N ld-elf/seg.t
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- ld-elf/seg.t 19 Dec 2007 10:20:40 -0000
***************
*** 0 ****
--- 1,16 ----
+
+ SECTIONS
+ {
+ reset - 4 :
+ {
+ *(reset)
+ }
+ boot - 0x1000 :
+ {
+ *(boot)
+ } = 0xffff
+ . = + SIZEOF_HEADERS;
+ .text : { *(.text) }
+ .data : { *(.data) }
+ .bss : { *(.bss) }
+ }