[ld, testsuite] Don't print to stdin for "readelf -w" to avoid buffer overflow
Jiong Wang
jiong.wang@foss.arm.com
Sat Feb 4 15:25:00 GMT 2017
Andreas Schwab writes:
> On Feb 03 2017, Jiong Wang <jiong.wang@foss.arm.com> wrote:
>
>> diff --git a/ld/testsuite/ld-elf/compress.exp b/ld/testsuite/ld-elf/compress.exp
>> index 5620f3c..3fb4bd7 100644
>> --- a/ld/testsuite/ld-elf/compress.exp
>> +++ b/ld/testsuite/ld-elf/compress.exp
>> @@ -171,7 +171,7 @@ if { [regexp_diff tmpdir/$test.out $srcdir/$subdir/$test.rt] } then {
>> set test_name "Link with zlib compressed debug output"
>> set test normal
>> send_log "$READELF -w tmpdir/$test > tmpdir/$test.out\n"
>> -set got [remote_exec host "$READELF -w tmpdir/$test" "" "/dev/null" "tmpdir/$test.out"]
>> +set got [remote_exec host [concat sh -c [list "$READELF -w tmpdir/$test > tmpdir/$test.out"]] "" "/dev/null"]
>
> Why do you need sh -c?
To be honest, I do not know much about Tcl/Expect, so was trying to
follow existed use cases. I had grep through ld testsuite, and found
similar cases are using " [concat sh -c..."
grep "remote_exec.*concat" $LD/testsuite/ -r
Thanks.
--
Regards,
Jiong
More information about the Binutils
mailing list