--- /dev/null
+ BYTE(0x43);
+ BYTE(0x4F);
+ BYTE(0x44);
+ BYTE(0x45);
+ BYTE(0xDE);
+ BYTE(0xAD);
+ BYTE(0xBE);
+ BYTE(0xEF);
+ QUAD(0);
--- /dev/null
+#source: crc32-poly.s
+#ld: -T crc32-poly.t
+#objdump: -s -j .text
+#target: [is_elf_format] [is_coff_format]
+#notarget: [is_aout_format]
+#xfail: tic4x-*-* tic54x-*-*
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
+
+.*: file format .*
+
+Contents of section .text:
+ 1200 434f4445 deadbeef 00000000 00000000 CODE............
+ 1210 cbf43926 00000000 00000000 00000000 ..9&............
+ 1220 cbf43926 00000000 00000000 00000000 ..9&............
+ 1230 00000000 00000000 deadbeef 434f4445 ............CODE
+ 1240 31323334 35363738 3900ffff ffffffff 123456789.......
+ 1250 434f4445 00000000 00000000 00000000 CODE............
+ 1260 ffffffff ffffffff ffffffff ffffffff .*
+#...
+ 17e0 434f4445 deadbeef 00000000 00000000 CODE............
+ 17f0 44494745 53542054 41424c45 00000000 DIGEST TABLE....
+#...
+ 1c00 454e4420 5441424c 45000000 00000000 END TABLE.......
+ 1c10 00000000 00000000 deadbeef 434f4445 ............CODE
+#pass
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0xCB);
+ BYTE(0xF4);
+ BYTE(0x39);
+ BYTE(0x26);
+ LONG(0x0);
+ QUAD(0x0);
+
+
+ crc32 = .;
+ DIGEST "_CRC32#BE" POLY(32, 0x04C11DB7, 0xFFFFFFFF,0xFFFFFFFF,1,1,0 )(ecc_start , ecc_end)
+ LONG(0);
+ QUAD(0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc32.s
+#ld: -T crc32.t
+#objdump: -s -j .text
+#target: [is_elf_format] [is_coff_format]
+#notarget: [is_aout_format]
+#xfail: tic4x-*-* tic54x-*-*
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
+
+.*: file format .*
+
+Contents of section .text:
+ 1200 434f4445 deadbeef 00000000 00000000 CODE............
+ 1210 cbf43926 00000000 00000000 00000000 ..9&............
+ 1220 cbf43926 00000000 00000000 00000000 ..9&............
+ 1230 00000000 00000000 deadbeef 434f4445 ............CODE
+ 1240 31323334 35363738 3900ffff ffffffff 123456789.......
+ 1250 434f4445 00000000 00000000 00000000 CODE............
+ 1260 ffffffff ffffffff ffffffff ffffffff .*
+#...
+ 17e0 434f4445 deadbeef 00000000 00000000 CODE............
+ 17f0 44494745 53542054 41424c45 00000000 DIGEST TABLE....
+#...
+ 1c00 454e4420 5441424c 45000000 00000000 END TABLE.......
+ 1c10 00000000 00000000 deadbeef 434f4445 ............CODE
+#pass
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0xCB);
+ BYTE(0xF4);
+ BYTE(0x39);
+ BYTE(0x26);
+ LONG(0x0);
+ QUAD(0x0);
+
+ crc32 = .;
+ DIGEST "_CRC32#BE" "CRC32" (ecc_start , ecc_end);
+ LONG(0);
+ QUAD(0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-bad-endian-size.s
+#ld: -T crc64-bad-endian-size.t
+# error: .*: bad 'endian' .* in digest label.*
+#skip: tic4x-coff, tic54x-cof
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "_CRC64#NE" "CRC64-ECMA" (ecc_start , ecc_end);
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-bad-endian-size.s
+#ld: -T crc64-bad-endian-size.t
+# error: .*: bad 'endian' .* in digest label.*
+#skip: tic4x-coff, tic54x-cof
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "_CRC64#BEG" "CRC64-ECMA" (ecc_start , ecc_end);
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-bad-label-2.s
+#ld: -T crc64-bad-label-2.t
+# error: .*: Illegal label .* in digest command.*
+#skip: tic4x-coff, tic54x-cof
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "_CRC^64#BE" "CRC64-ECMA" (ecc_start , ecc_end);
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-bad-label.s
+#ld: -T crc64-bad-label.t
+# error: .*: Illegal label .* in digest command.*
+#skip: tic4x-coff, tic54x-cof
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "0_CRC64#BE" "CRC64-ECMA" (ecc_start , ecc_end);
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-ecma.s
+#ld: -T crc64-ecma.t
+#objdump: -s -j .text
+#target: [is_elf_format] [is_coff_format]
+#notarget: [is_aout_format]
+#xfail: tic4x-*-* tic54x-*-*
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
+
+.*: file format .*
+
+Contents of section .text:
+ 1200 434f4445 deadbeef 00000000 00000000 CODE............
+ 1210 6c40df5f 0b497347 00000000 00000000 l@._.IsG........
+ 1220 6c40df5f 0b497347 00000000 00000000 l@._.IsG........
+ 1230 00000000 00000000 deadbeef 434f4445 ............CODE
+ 1240 31323334 35363738 3900ffff ffffffff 123456789.......
+ 1250 434f4445 00000000 00000000 00000000 CODE............
+ 1260 ffffffff ffffffff ffffffff ffffffff .*
+#...
+ 17e0 434f4445 deadbeef 00000000 00000000 CODE............
+ 17f0 44494745 53542054 41424c45 00000000 DIGEST TABLE....
+#...
+ 2000 454e4420 5441424c 45000000 00000000 END TABLE.......
+ 2010 00000000 00000000 deadbeef 434f4445 ............CODE
+#pass
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "_CRC64#BE" "CRC64-ECMA" (ecc_start , ecc_end);
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-in-section.s
+#ld: -T crc64-in-section.t
+#error: .*: CRC located inside checked area
+#skip: tic4x-coff, tic54x-cof
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+
+ QUAD(0x0);
+
+ crc64 = .;
+ bad_start = .;
+ DIGEST "_CRC64#BE" "CRC64-ECMA" (bad_start , ecc_end);
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-iso.s
+#ld: -T crc64-iso.t
+#objdump: -s -j .text
+#target: [is_elf_format] [is_coff_format]
+#notarget: [is_aout_format]
+#xfail: tic4x-*-* tic54x-*-*
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
+
+.*: file format .*
+
+Contents of section .text:
+ 1200 434f4445 deadbeef 00000000 00000000 CODE............
+ 1210 b90956c7 75a41001 00000000 00000000 ..V.u...........
+ 1220 b90956c7 75a41001 00000000 00000000 ..V.u...........
+ 1230 00000000 00000000 deadbeef 434f4445 ............CODE
+ 1240 31323334 35363738 3900ffff ffffffff 123456789.......
+ 1250 434f4445 00000000 00000000 00000000 CODE............
+ 1260 ffffffff ffffffff ffffffff ffffffff .*
+#...
+ 17e0 434f4445 deadbeef 00000000 00000000 CODE............
+ 17f0 44494745 53542054 41424c45 00000000 DIGEST TABLE....
+#...
+ 2000 454e4420 5441424c 45000000 00000000 END TABLE.......
+ 2010 00000000 00000000 deadbeef 434f4445 ............CODE
+#pass
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0xb9);
+ BYTE(0x09);
+ BYTE(0x56);
+ BYTE(0xc7);
+ BYTE(0x75);
+ BYTE(0xa4);
+ BYTE(0x10);
+ BYTE(0x01);
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "_CRC64#BE" "CRC64-GO-ISO" (ecc_start , ecc_end)
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-iso_be.s
+#ld: -T crc64-iso_be.t
+#objdump: -s -j .text
+#target: [is_elf_format] [is_coff_format]
+#notarget: [is_aout_format]
+#xfail: tic4x-*-* tic54x-*-*
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
+
+.*: file format .*
+
+Contents of section .text:
+ 1200 434f4445 deadbeef 00000000 00000000 CODE............
+ 1210 0110a475 c75609b9 00000000 00000000 ...u.V..........
+ 1220 0110a475 c75609b9 00000000 00000000 ...u.V..........
+ 1230 00000000 00000000 deadbeef 434f4445 ............CODE
+ 1240 31323334 35363738 3900ffff ffffffff 123456789.......
+ 1250 434f4445 00000000 00000000 00000000 CODE............
+ 1260 ffffffff ffffffff ffffffff ffffffff .*
+#...
+ 17e0 434f4445 deadbeef 00000000 00000000 CODE............
+ 17f0 44494745 53542054 41424c45 00000000 DIGEST TABLE....
+#...
+ 2000 454e4420 5441424c 45000000 00000000 END TABLE.......
+ 2010 00000000 00000000 deadbeef 434f4445 ............CODE
+#pass
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x01);
+ BYTE(0x10);
+ BYTE(0xa4);
+ BYTE(0x75);
+ BYTE(0xc7);
+ BYTE(0x56);
+ BYTE(0x09);
+ BYTE(0xb9);
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "_CRC64" "CRC64-GO-ISO" (ecc_start , ecc_end)
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table_be.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-multiple-digest.s
+#ld: -T crc64-multiple-digest.t
+# error: .*: Duplicate digest .*
+#skip: tic4x-coff, tic54x-cof
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "_CRC64A#BE" "CRC64-ECMA" (ecc_start , ecc_end);
+ DIGEST "_CRC64B#BE" "CRC64-ISO" (ecc_start , ecc_end);
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-poly-size.s
+#ld: -T crc64-poly-size.t
+# error: .*: Illegal Size in DIGEST: .*
+#skip: tic4x-coff, tic54x-cof
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "_CRC64#BE" POLY(80,0x42F0E1EBA9EA3693,0,0,0,0,0)(ecc_start , ecc_end)
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-poly.s
+#ld: -T crc64-poly.t
+#objdump: -s -j .text
+#target: [is_elf_format] [is_coff_format]
+#notarget: [is_aout_format]
+#xfail: tic4x-*-* tic54x-*-*
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
+
+.*: file format .*
+
+Contents of section .text:
+ 1200 434f4445 deadbeef 00000000 00000000 CODE............
+ 1210 6c40df5f 0b497347 00000000 00000000 l@._.IsG........
+ 1220 6c40df5f 0b497347 00000000 00000000 l@._.IsG........
+ 1230 00000000 00000000 deadbeef 434f4445 ............CODE
+ 1240 31323334 35363738 3900ffff ffffffff 123456789.......
+ 1250 434f4445 00000000 00000000 00000000 CODE............
+ 1260 ffffffff ffffffff ffffffff ffffffff .*
+#...
+ 17e0 434f4445 deadbeef 00000000 00000000 CODE............
+ 17f0 44494745 53542054 41424c45 00000000 DIGEST TABLE....
+#...
+ 2000 454e4420 5441424c 45000000 00000000 END TABLE.......
+ 2010 00000000 00000000 deadbeef 434f4445 ............CODE
+#pass
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "_CRC64#BE" POLY(64,0x42F0E1EBA9EA3693,0,0,0,0,0)(ecc_start , ecc_end)
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-reverse-area.s
+#ld: -T crc64-reverse-area.t
+# error: .*: CRC area starts after its end location.*
+#skip: tic4x-coff, tic54x-cof
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "_CRC64#BE" "CRC64-ECMA" (ecc_end, ecc_start);
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-same-section.s
+#ld: -T crc64-same-section.t
+#error: .*: The CRC digest and table should be inside the .*
+#skip: tic4x-coff, tic54x-cof
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .crc ALIGN (0x200) :
+ {
+ crc64 = .;
+ DIGEST "_CRC64#BE" "CRC64-ECMA" (ecc_start , ecc_end);
+ } > rom
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+
+ QUAD(0x0);
+
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-section.s
+#ld: -T crc64-section.t
+#objdump: -s -j .foo
+#target: [is_elf_format] [is_coff_format]
+#notarget: [is_aout_format]
+#xfail: tic4x-*-* tic54x-*-*
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
+
+.*: file format .*
+
+Contents of section .foo:
+ 1200 434f4445 deadbeef 00000000 00000000 CODE............
+ 1210 6c40df5f 0b497347 00000000 00000000 l@._.IsG........
+ 1220 6c40df5f 0b497347 00000000 00000000 l@._.IsG........
+ 1230 00000000 00000000 deadbeef 434f4445 ............CODE
+ 1240 31323334 35363738 3900ffff ffffffff 123456789.......
+ 1250 434f4445 00000000 00000000 00000000 CODE............
+ 1260 ffffffff ffffffff ffffffff ffffffff .*
+#...
+ 17e0 434f4445 deadbeef 00000000 00000000 CODE............
+ 17f0 44494745 53542054 41424c45 00000000 DIGEST TABLE....
+#...
+ 2000 454e4420 5441424c 45000000 00000000 END TABLE.......
+ 2010 00000000 00000000 deadbeef 434f4445 ............CODE
+#pass
--- /dev/null
+ .extern ecc_start
+ .section .foo
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .foo ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "_CRC64#BE" "CRC64-ECMA" (ecc_start , ecc_end);
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ ecc_start = .;
+ ASCIZ "123456789"
+ ecc_end = . - 1;
+ . = ALIGN(0x10);
+
+ entry = .;
+ *(.foo)
+ . = ALIGN(0x100);
+ BYTE(1);
+ INCLUDE "digest_table.inc"
+ } > rom
+ .text ALIGN (0x200) :
+ {
+ *(.text)
+ QUAD(0x0)
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: crc64-unknown-digest.s
+#ld: -T crc64-unknown-digest.t
+# error: .*: Unknown digest.*
+#skip: tic4x-coff, tic54x-cof
+#skip: ns32k-pc532-macho, pdp11-dec-aout, powerpc-ibm-aix5.2.0
+#skip: rs6000-aix4.3.3, alpha-linuxecoff
--- /dev/null
+ .extern ecc_start
+ .section .text
+main:
+ .byte 0x43
+ .byte 0x4F
+ .byte 0x44
+ .byte 0x45
+ .long 0
+ .long 0
+ .long 0
+ .section .data
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xde
+ .byte 0xad
+ .byte 0xbe
+ .byte 0xef
+ .section .bss
+ .long 0
--- /dev/null
+MEMORY {
+ rom : ORIGIN = 0x000000, LENGTH = 0x4000
+ ram : ORIGIN = 0x008000, LENGTH = 0x1000
+}
+
+_start = 0x000000;
+SECTIONS
+{
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x200) :
+
+ {
+ FILL(0xFF)
+ header = .;
+ INCLUDE "begin_tag.inc"
+
+ expected = .;
+ BYTE(0x6C);
+ BYTE(0x40);
+ BYTE(0xDF);
+ BYTE(0x5F);
+ BYTE(0x0B);
+ BYTE(0x49);
+ BYTE(0x73);
+ BYTE(0x47);
+
+ QUAD(0x0);
+
+ crc64 = .;
+ DIGEST "_CRC64#BE" "TCRC64-ECMA" (ecc_start , ecc_end);
+ QUAD(0x0);
+
+ INCLUDE "end_tag.inc"
+
+ INCLUDE "crc_data.inc"
+
+ INCLUDE "digest_table.inc"
+ } > rom
+
+ .data : AT (0x008000) { *(.data) } >ram /* NO default AT>rom */
+ . = ALIGN(0x20);
+ .bss : { *(.bss) } >ram /* NO default AT>rom */
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+ ecc_start = .;
+ ASCIZ "123456789"
+ ecc_end = . - 1;
+ . = ALIGN(0x10);
+
+ entry = .;
+ *(.text)
+ . = ALIGN(0x100);
+ BYTE(1);
--- /dev/null
+ . = ALIGN(2048) - 32;
+ INCLUDE "begin_tag.inc"
+ ASCII (16) "DIGEST TABLE"
+ DIGEST TABLE "CRCTAB"
+ ASCII (16) "END TABLE"
+ INCLUDE "end_tag.inc"
--- /dev/null
+ . = ALIGN(2048) - 32;
+ INCLUDE "begin_tag.inc"
+ ASCII (16) "DIGEST TABLE"
+ DIGEST TABLE "CRCTAB.BE"
+ ASCII (16) "END TABLE"
+ INCLUDE "end_tag.inc"
--- /dev/null
+ QUAD(0);
+ BYTE(0xDE);
+ BYTE(0xAD);
+ BYTE(0xBE);
+ BYTE(0xEF);
+ BYTE(0x43);
+ BYTE(0x4F);
+ BYTE(0x44);
+ BYTE(0x45);
run_dump_test "asciz"
run_dump_test "ascii"
+run_dump_test "crc64-ecma"
+run_dump_test "crc64-iso"
+run_dump_test "crc64-iso_be"
+run_dump_test "crc64-poly"
+run_dump_test "crc32"
+run_dump_test "crc32-poly"
+run_dump_test "crc64-reverse-area"
+run_dump_test "crc64-in-section"
+run_dump_test "crc64-same-section"
+run_dump_test "crc64-multiple-digest"
+run_dump_test "crc64-unknown-digest"
+run_dump_test "crc64-poly-size"
+run_dump_test "crc64-bad-label"
+run_dump_test "crc64-bad-label-2"
+run_dump_test "crc64-bad-endian-size"
+run_dump_test "crc64-bad-endian-contents"
+
run_dump_test "align-with-input"
run_dump_test "pr20302"
run_dump_test "output-section-types"