[PATCH v4 2/5] CRC64 testsuite

Nick Clifton nickc@redhat.com
Tue Feb 21 12:42:08 GMT 2023


Hi Ulf,

> diff --git a/ld/testsuite/ld-scripts/crc32-poly.d b/ld/testsuite/ld-scripts/crc32-poly.d

Did you actually try running these new tests ?


> +Contents of section .text:
> + 1100 434f4445 deadbeef 712c8793 0c110000  CODE....q,......

These lines are regular expressions, not exact text matches so,
for example:

> + 2030 c5648dc3 17584c28 be6054a9 6c5c9542  .d...XL(.`T.l\.B

Is bad because ( is a regexp control character.  In fact when I
run this particular test I get this output:

   ERROR: couldn't compile regular expression pattern: parentheses () not balanced
     while executing
   "regexp "^$line_bx$" "$line_a""
     (procedure "regexp_diff" line 121)
     invoked from within
   "regexp_diff $dumpfile "${dfile}" $regexp_subst"
     (procedure "run_dump_test" line 667)
     invoked from within
   "run_dump_test "crc32-poly""

Since I assume that the textual interpretation of the binary values
is not important you can just use the period character to match any
text:

     2030 c5648dc3 17584c28 be6054a9 6c5c9542  ................

Or just:

     2030 c5648dc3 17584c28 be6054a9 6c5c9542  .*

Also, you can skip filler lines using "#..." if you want, in order to
make the .d files short.  So for example:

> + 1120 434f4445 0c110000 ffffffff ffffffff  CODE............
> + 1130 ffffffff ffffffff ffffffff ffffffff  ................
...
> + 1fe0 ffffffff ffffffff ffffffff ffffffff  ................
> + 1ff0 ffffffff ffffffff 434f4445 deadbeef  ........CODE....

Could be written as:

     1120 434f4445 0c110000 ffffffff ffffffff  CODE.*
     #...
     1ff0 ffffffff ffffffff 434f4445 deadbeef  .*CODE.*


Also, be wary of using values larger than a byte:

 > + 1ff0 ffffffff ffffffff 434f4445 deadbeef  ........CODE....

This works if the target is little endian, but on big
endian architecture the bytes will be in a different order.

Cheers
   Nick



More information about the Binutils mailing list