length.
* ld-mmix/sec-9.d: Renamed test, formerly known as sec-5.d.
* ld-mmix/sec-5.d, ld-mmix/b-offloc.s: Rewritten test.
2004-10-24 Hans-Peter Nilsson <hp@bitrange.com>
+ * ld-mmix/sec-8m.d: Adjust test for dump using correct section
+ length.
+ * ld-mmix/sec-9.d: Renamed test, formerly known as sec-5.d.
+ * ld-mmix/sec-5.d, ld-mmix/b-offloc.s: Rewritten test.
+
* ld-mmix/getaa-6b.d, ld-mmix/getaa-6f.d, ld-mmix/getaa14b.d,
ld-mmix/getaa14f.d, ld-mmix/jumpa-6b.d, ld-mmix/jumpa-6f.d,
ld-mmix/jumpa14b.d, ld-mmix/jumpa14f.d, ld-mmix/reg-1.d,
--- /dev/null
+% The .text contents is supposed to be linked --oformat binary with
+% b-post1.s and b-goodmain.s. The code below will provide a LOP_LOC
+% with a 64-bit address (0x789abcdef0123456) then 16 bytes of % random data.
+
+ .text
+ .byte 0x98,1,0,2
+ .8byte 0x789abcdef0123458
+ .byte 0xb0,0x45,0x19,0x7d,0x2c,0x1b,0x3,0xb2
+ .byte 0xe4,0xdb,0xf8,0x77,0xf,0xc7,0x66,0xfb
-#source: start.s
-#ld: -m mmo -T $srcdir/$subdir/mmosec2.ld
+#source: b-twoinsn.s
+#source: b-offloc.s
+#source: b-post1.s
+#source: b-goodmain.s
+#ld: --oformat binary
#objdump: -sh
# Check that sections are automatically created to cope with contents at
-# unexpected addresses. We do this by linking .text at an unexpected
-# address. As .text (like .data) does not get a section descriptor, the
-# output gets a LOP_LOC at an unexpected address, and a unique section is
-# created. This test will have to be changed if .text gets a section
-# descriptor if linked to an unexpected address.
+# unexpected addresses when an mmo is read in. We used to do this by
+# e.g. linking .text at an unexpected address, like in sec-9.d. That no
+# longer works, because .text and .data now gets section descriptors at
+# mmo output when the address and contents doesn't trivially reflect the
+# section contents at link time. To test, we instead read in an mmo
+# formed from a link to binary format, like the b-*.d tests for mmo
+# execution paths.
.*: file format mmo
Sections:
Idx Name Size VMA LMA File off Algn
- 0 \.text 0+ 0+ 0+ 0+ 2\*\*2
-
- 1 \.MMIX\.sec\.0 0+4 1000000000000000 1000000000000000 0+ 2\*\*2
+ 0 \.text 0+8 0+ 0+ 0+ 2\*\*2
+ CONTENTS, ALLOC, LOAD, CODE
+ 1 \.MMIX\.sec\.0 0+10 789abcdef0123458 789abcdef0123458 0+ 2\*\*2
CONTENTS, ALLOC, LOAD
+Contents of section \.text:
+ 0+ e3fd0001 e3fd0004 .*
Contents of section \.MMIX\.sec\.0:
- 1000000000000000 e3fd0001 .*
+ 789abcdef0123458 b045197d 2c1b03b2 e4dbf877 0fc766fb .*
# with a leading multiple-of-four number of zero bytes, those zero bytes
# would be omitted, and the "saved" bytes would be concatenated with the
# following (not-all-zeros) bytes. Hence a shift of the last bytes of the
-# first chunk. Note that the section will be padded in the output.
+# first chunk.
.*: file format mmo
10010 33000000 00000000 00000000 00000000 .*
10020 00300000 00000000 00000000 00000000 .*
#...
- 18020 31000000 .*
+ 18020 31 .*
--- /dev/null
+#source: start.s
+#ld: -m mmo -T $srcdir/$subdir/mmosec2.ld
+#objdump: -sh
+
+# This is based on sec-5.d which used to link .text at an unexpected
+# address to check that a special section was created in objdump when
+# reading in contents at an unusual location without a proper section
+# descriptor. As .text (like .data) now gets a section descriptor when
+# linked to an unexpected location, the old test is transformed into a
+# specific check that the section description for .text works.
+
+.*: file format mmo
+
+Sections:
+Idx Name Size VMA LMA File off Algn
+ 0 \.text 0+4 1000000000000000 1000000000000000 0+ 2\*\*2
+ CONTENTS, ALLOC, LOAD, READONLY, CODE
+Contents of section \.text:
+ 1000000000000000 e3fd0001 .*