[PATCH] ld: fix ld-elf/linux-x86.exp for r/o source tree

Jan Beulich jbeulich@suse.com
Tue Jun 2 07:12:45 GMT 2020


Since the copying ofthe individual files gets done more than once, make
sure the destinations can be copied to on subsequent copying attempts.

ld/
2020-06-XX  Jan Beulich  <jbeulich@suse.com>

	* testsuite/ld-elf/linux-x86.exp: Make copied source files
	writeable.

---
An alternative would be to "rm -f" the destinations up front; there are
surely further alternatives. Not sure which one's the most portable one.
---
I'd like to point out that, with the issue here fixed and on an oldish
system, several of the subcases of this test fail for me with
"compilation failed", and four subcases actually fail their run tests.
I didn't have the time to look into those, yet.

--- a/ld/testsuite/ld-elf/linux-x86.exp
+++ b/ld/testsuite/ld-elf/linux-x86.exp
@@ -134,6 +134,7 @@ proc check_pr25749a {testname srcfilea s
     }
 
     exec cp $srcdir/$subdir/$srcfilea $srcfilea
+    exec chmod +w $srcfilea
     set pr25749_bin "$objcopy -B $output_arch -I binary -O $output_target $srcfilea tmpdir/pr25749-bin.o"
     send_log "$pr25749_bin\n"
     set got [remote_exec host "$pr25749_bin"]
@@ -237,6 +238,7 @@ proc check_pr25749b {testname srcfilea s
     }
 
     exec cp $srcdir/$subdir/$srcfilea $srcfilea
+    exec chmod +w $srcfilea
     set pr25749_bin "$objcopy -B $output_arch -I binary -O $output_target $srcfilea tmpdir/pr25749-bin.o"
     send_log "$pr25749_bin\n"
     set got [remote_exec host "$pr25749_bin"]


More information about the Binutils mailing list