[binutils-gdb/binutils-2_46-branch] gprof: fix testsuite with older glibc

Sam James via Binutils-cvs <[email protected]>
Newsgroups gmane.comp.gnu.binutils.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a195046618ec35f2c1e3b5413895f30b399b8d58

commit a195046618ec35f2c1e3b5413895f30b399b8d58
Author: Jan Beulich <[email protected]>
Date:   Fri Feb 13 10:19:39 2026 +0100

    gprof: fix testsuite with older glibc
    
    It is quite sad that 2.46 has again shipped with this breakage. Short of
    those responsible taking care, use the workaround that was suggested in
    https://sourceware.org/pipermail/binutils/2025-April/140316.html.
    
    (cherry picked from commit 1319410a1e9d857f15c9019a87d6d4b62fa6d39a)

Diff:
---
 gprof/testsuite/tst-gmon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gprof/testsuite/tst-gmon.c b/gprof/testsuite/tst-gmon.c
index 0efc5c791b0..37b37af33b0 100644
--- a/gprof/testsuite/tst-gmon.c
+++ b/gprof/testsuite/tst-gmon.c
@@ -45,6 +45,7 @@ f3 (int count)
     }
 }
 
+__attribute__ ((section (".text.main"))) /* See glibc bug 28153.  */
 int
 main (void)
 {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.