From d48b742bc1a7af6a673e747c91bf7c72518a0b6a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 3 Sep 2020 09:34:37 +0930 Subject: heap use after free in xcoff_archive_info_eq Using an input file objalloc memory for anything that isn't created when opening the bfd is not a good idea. The problem is that this memory can disappear if bfd_free_cached_info is called or when bfd closes files in order to keep the number of open files reasonable. bfd/ * xcofflink.c (xcoff_get_archive_info): Allocate xcoff_archive_info on the output bfd objalloc memory. ld/ * testsuite/ld-scripts/sysroot-prefix.exp (single_sysroot_prefix_test): Log $scriptname. --- ld/testsuite/ld-scripts/sysroot-prefix.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ld/testsuite/ld-scripts') diff --git a/ld/testsuite/ld-scripts/sysroot-prefix.exp b/ld/testsuite/ld-scripts/sysroot-prefix.exp index e8b45d1..b7590e2 100644 --- a/ld/testsuite/ld-scripts/sysroot-prefix.exp +++ b/ld/testsuite/ld-scripts/sysroot-prefix.exp @@ -164,7 +164,7 @@ proc single_sysroot_prefix_test { type xtestname finalscript ldopt errstr } { puts $ofd "$finalscript" close $ofd - verbose -log "script: $finalscript" + verbose -log "script $scriptname: $finalscript" set res [ld_link $ld tmpdir/output "$ldopt tmpdir/main.o -Ltmpdir -lsysroottest"] set ld_output "$exec_output" -- cgit v1.1