[PATCH] gprof: Fix tests on Solaris [PR34237]

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Tue Jun 9 08:03:58 GMT 2026


The gprof tests FAIL on Solaris:

tst-gmon-gprof.sh ../gprof tst-gmon
--- expected
+++ actual
@@ -1,3 +1,4 @@
 f1 2000
 f2 1000
 f3 1
+main 1
FAIL

main is included in the call graph, probably because Solaris still uses
the original BSD gmon.out format.

This patch allows for that difference.  To distinguish between targets
with non-default handling, $target is passed to the test scripts.

As detailed in the PR, the powerpc with function descriptors special
case only applies to AIX, so that variant is guarded accordingly.

Tested on amd64-pc-solaris2.11, sparcv9-sun-solaris2.11, and
x86_64-pc-linux-gnu.

Ok for trunk?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2026-06-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gprof:
	PR gprof/34237
	* testsuite/Makefile.am (tst-gmon-gprof.out): Pass $(target) to
	tst-gmon-gprof.sh.
	(tst-gmon-gprof-l.out): Likewise.
	(tst-gmon-gprof-l2.out): Likewise.
	* testsuite/Makefile.in: Regenerate.

	* testsuite/tst-gmon-gprof.sh (expected_dot): Remove.
	<*-*-solaris2*>: Allow main in execution counters.
	<powerpc-*-aix* | rs6000-*-aix*>: Handle function descriptor case here.
	* testsuite/tst-gmon-gprof-l.sh: Likewise.
	* testsuite/tst-gmon-gprof-l2.sh: Likewise.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sol2-gprof-tests.patch
Type: text/x-patch
Size: 6703 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20260609/8d28ec3a/attachment.bin>


More information about the Binutils mailing list