]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
tekhex test for commit bf0f85df1254
authorAlan Modra <amodra@gmail.com>
Tue, 26 Aug 2025 09:20:30 +0000 (18:50 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 27 Aug 2025 12:15:12 +0000 (21:45 +0930)
* testsuite/binutils-all/tek2.obj: Change to a 3 byte data file
that triggers tekhex error fixed by commit bf0f85df1254.
* testsuite/binutils-all/ar.exp: Adjust to suit.
* testsuite/binutils-all/objcopy.exp (objcopy_tek2bin): New proc.

binutils/testsuite/binutils-all/ar.exp
binutils/testsuite/binutils-all/objcopy.exp
binutils/testsuite/binutils-all/tek2.obj

index d06fe90c8c5e20312ed547859c28138e302d251e..f38dce5f8a9968a195e35a068d0e8e51aad404cc 100644 (file)
@@ -1013,8 +1013,8 @@ tek1.obj:
 *: no symbols
 
 tek2.obj:
-00000001 D _binary_x_end
-00000001 A _binary_x_size
+00000003 D _binary_x_end
+00000003 A _binary_x_size
 00000000 D _binary_x_start
 } $got] {
        fail $testname
index ac8978fef2b04bbf4c0b331f3c3b6dae4cfa4776..90be636e9defefa3b39102cc2545318646eedb0f 100644 (file)
@@ -1567,3 +1567,33 @@ if { ![is_xcoff_format] } {
 }
 
 run_dump_test "rename-section-01"
+
+proc objcopy_tek2bin {} {
+    global OBJCOPY
+    global OBJDUMP
+    global srcdir
+    global subdir
+
+    set tek $srcdir/$subdir/tek2.obj
+    set out tmpdir/tek2bin
+    if [isremote host] {
+       set tek [remote_download host $tek]
+       set out tek2bin
+    }
+
+    set got [binutils_run $OBJCOPY "-O binary $tek $out"]
+    if ![string equal "" $got] then {
+       send_log "$got\n"
+       fail "objcopy tek2bin"
+    } else {
+       set got [binutils_run $OBJDUMP "-s -b binary $out"]
+       if {![regexp ".* 0000 000031 .*" $got]} {
+           fail "objcopy tek2bin (objdump)"
+       } else {
+           pass "objcopy tek2bin"
+       }
+    }
+    remote_file host delete $out
+}
+
+objcopy_tek2bin
index da696d1773e9760209632586b672c6f0c6ae688a..a4e29af91344aa1d50cfc899196e5ac37d212116 100644 (file)
@@ -1,6 +1,6 @@
-%47615103000000000000000000000000000000000000000000000000000000000000000
-%103E95.data11011
+%47616100000310000000000000000000000000000000000000000000000000000000000
+%103EB5.data11013
 %1E3FB5.data4F_binary_x_start10
-%1C3735.data4D_binary_x_end11
-%1D3135*ABS*2E_binary_x_size11
+%1C3755.data4D_binary_x_end13
+%1D3155*ABS*2E_binary_x_size13
 %0781010