From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ABGfA+dKSmTDqTcAWB0awg (envelope-from ) for ; Thu, 27 Apr 2023 06:13:59 -0400 Received: by simark.ca (Postfix, from userid 112) id F29821E221; Thu, 27 Apr 2023 06:13:58 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=hBmUmL3/; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 424F61E0D3 for ; Thu, 27 Apr 2023 06:13:58 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 34DD53858C74 for ; Thu, 27 Apr 2023 10:13:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 34DD53858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1682590437; bh=hvBqwcS9pye+UfCYIxVnsiGRwF7D1j85kDu3rPBADZA=; h=To:CC:Subject:Date:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=hBmUmL3/W5VvWTVOZ+18+6x40JM7xoxiUAcwMYOnQPux2FfZuD/sm+H7oa+gQ6iVI CFcrRdzm6kGxBpV62ttVFeBqIoyGfGM2bKlZ2a2H4QAIcLtEd4mPPF1LtpSVKoaeoV z3zAR5T5XhIs48heA+TSsnW/3s6x7esUaBzUJEFg= Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 8FDE63858D32 for ; Thu, 27 Apr 2023 10:13:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8FDE63858D32 Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33RAA2P4027194; Thu, 27 Apr 2023 10:13:34 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3q7hurrht5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Apr 2023 10:13:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hTewzRzioN7Es0LvI42iYs/GqQKHSRI3No1ULlP6GqVea7/ss0uf7o1DaveO8H1o4h6Xd/TiyWHcwKZqk59TXr8vHKxu/s058zZU7Ez4Gdju19wSbTtFWaAzcwFOPAzSCpJrDSbHI/7aEi3LxP7u3xpPjlirvCZxdrBOc+/VMcuSDz6N7AfB+Mw11JynGnYiQvOEEWMcl9+A730kO92e3ri/R8/xUVV3k+3zQLAuM9N5eBCZz2PfhlStBPoNJr/f67D2dwjp9bJDgtYmi5Z3i8rVOzxvlE3GkX71/m88JL9TUGfevQMBfTF6TzHvGPWa3G3Div7WetdQ+lgA65JqoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=deehzqX75GXb1IwvOwE+iQTRO8AZh9UyKyp2iGnzV8w=; b=HpQsgeKFVonpVdTWNhsd5llTxg8MbZ099RNRb5IoJNofjMtqQNojblajfINI10TDEoaFz7PlMPM8H5r3g2RVE3RZdhE7imF3wE6HDYIw9248TwCApfBbvjp1kil+sbeFux3dfAhFRu/avyM+zIbtrazQL+2roGqx41a+cZj89XJP/jIeCpLnLY/dbqgt25Cafcs9C3AUatBzzkMxuSJFCuyYg1Eo/wZxbGgGi4jD6PhDFUNhe6wKMmgdkgcn3caAtQoJRl0Og2TXK2G5tRK2GVzs03Rk0sb//95sC11i0qJnRqZ2UhcQd3R7I4bR5DQsFpBEgG2hpMvAYKAKt5KRWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ibm.com; dmarc=pass action=none header.from=ibm.com; dkim=pass header.d=ibm.com; arc=none Received: from CH2PR15MB3544.namprd15.prod.outlook.com (2603:10b6:610:5::26) by SA1PR15MB4580.namprd15.prod.outlook.com (2603:10b6:806:19c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.21; Thu, 27 Apr 2023 10:13:30 +0000 Received: from CH2PR15MB3544.namprd15.prod.outlook.com ([fe80::fc4b:b8cb:1472:d50a]) by CH2PR15MB3544.namprd15.prod.outlook.com ([fe80::fc4b:b8cb:1472:d50a%6]) with mapi id 15.20.6340.022; Thu, 27 Apr 2023 10:13:30 +0000 To: Ulrich Weigand , "gdb-patches@sourceware.org" , "tom@tromey.com" CC: Sangamesh Mallayya , "simon.marchi@efficios.com" Subject: Re: [PATCH] Fix call functions command bug in 64-bit programs for AIX and PC read in psymtab-symtab warning Thread-Topic: [PATCH] Fix call functions command bug in 64-bit programs for AIX and PC read in psymtab-symtab warning Thread-Index: AQHZcd5L2dXxgi+CmEyMBkzt8Jq4Lq81r7/PgATz9ACABFYv4A== Date: Thu, 27 Apr 2023 10:13:29 +0000 Message-ID: References: <049a54779f7280ddef6c2da12d0714023514dc9b.camel@de.ibm.com> <881bbbcc3646f5df9c2f334133907d3ca37149a6.camel@de.ibm.com> <48b9cc7b5cb4981f03fd459c4365242a11546c1e.camel@de.ibm.com> <87r0xsb4np.fsf@tromey.com> <87sfd24j4w.fsf@tromey.com> <6dba16478c04d83780e4996236ba4fad4d7a5395.camel@de.ibm.com> <149511a0bc674c71674357a19915d8f454abb63a.camel@de.ibm.com> In-Reply-To: <149511a0bc674c71674357a19915d8f454abb63a.camel@de.ibm.com> Accept-Language: en-IN, en-US Content-Language: en-IN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH2PR15MB3544:EE_|SA1PR15MB4580:EE_ x-ms-office365-filtering-correlation-id: 3620c88e-1db2-4a2b-10e8-08db47080c61 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: I/xLI2svhrZ3PpOLMV54W1s5oig2uu5t7FzClf+MXFb5waHma1fRIrXURXdyScWQb2hrKJWdSdvRd6brPc9YchN8nqcftUIQ+mKef/IReJ2M0MydPvgwvQyoNNHjKiENJVtQCvAEVL2vrpKCCiEMUgrWhZIF/4kR11UMwUxySFUdQjxyXbiCp5n95Ab/1D+BMQCAuQ/9gVj/frdKEaahP9w2COjaQtHqIkSVDNlB5s5zKKUjJ04qxmqwTJV/mYptWuN+OgUpknpN3QG5n6zoyupA4uWQaQh+fSu9jTaAadEE8pmB0UI7eHVwc2Yk9QicBfiZaEa7t9/+lLkR/oDVeSqbP+NZcU9wBQKsKET2w7Rl1uk8RPEddANdFHLltDKLnrtEpxVl6SENsy/krj78GdPvrDQ8HNPT6KC9KE0Mx4TQqtdigeahn5IvzzWoD7I+MkBbOzVcu99T4Dw+12dnlVkjy5haSVBVUweluzEsbq9eixsjCi31wK6jITaheBM00pRtAc8K8338U+NO6CvsZo7daumgd7HkvjcgugIloH40UwvErBoHZ6JoBJetzcFHdMKVew0iBBCUz39ZUj2snTq4RdxCEbjicQdxGhrMkyI= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR15MB3544.namprd15.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(39860400002)(346002)(396003)(376002)(136003)(366004)(451199021)(7696005)(166002)(38070700005)(55016003)(38100700002)(86362001)(33656002)(83380400001)(122000001)(71200400001)(316002)(21615005)(478600001)(9686003)(53546011)(966005)(186003)(6506007)(110136005)(54906003)(26005)(66446008)(66476007)(66556008)(76116006)(8936002)(66946007)(4326008)(5660300002)(8676002)(91956017)(64756008)(2906002)(41300700001)(52536014); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ssbn/AHTvcoJGed2mIeazjfZPS9nTM6pHHxy0hcPrZS1dAB+Ow85/1Hb3q2N?= =?us-ascii?Q?+Ydpk+QoZojxMXQjJWTu+c1qAsMNBvhRwVJw8uDT99A1PU3Sv/34H34ds72j?= =?us-ascii?Q?8JzBcIfw55bBeVjR6om3xzlVMgnTENwJjA3XjEO1zvff66ScrIckqiQd/Ctz?= =?us-ascii?Q?9VbuKF4C1Avn8Hnn6ETHNtm9eYeOZBK5NvVUcxC0M60iDde1Om93+axIWfqs?= =?us-ascii?Q?NmllPstjN6RY9x7A/BWbWP8kBV0/+McmCgainMeBA6n893q4qB3B4neuFRI7?= =?us-ascii?Q?honwraddTvlQ9h5ic/d7z8rko6TuD4KRhwJv5s3OCMCHZ4Hi7S+Gh/2QrFp6?= =?us-ascii?Q?KZkf4XoXUbdg6p+IK6iyPSmc/1gwK3xckWrvMpSx2HbFtMzBDaw/y1S10vpG?= =?us-ascii?Q?slP4NGQtAtZ/8Qyf2VChv6M5gOtdjqr3eZjwwJA4l3VnotiIZKUxinWdbqBF?= =?us-ascii?Q?tkr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TuHkb+?= =?us-ascii?Q?8p3y1p69k0cds49h2RlrVw3d/LWp3mAWl//G5MCg5iHwevqVdIOmyMTmMX1w?= =?us-ascii?Q?OUwevFE4I/hcDUfA92vriG0RklcRjNx0pnBksomZpEjkWrM+n+lrN5O4BQ+H?= =?us-ascii?Q?ddIzWNbcd8zupJ0mL/O6vvdNisOfsMuxhjYWwipCMv5sR7EtceXaLrFCMK4S?= =?us-ascii?Q?6HzdXQlVG7eKGWHYYY1/5A9wSwGoXSbSALIUcQl92+e1Di06F6fLz21ateKN?= =?us-ascii?Q?Pg=3D=3D?= X-OriginatorOrg: ibm.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH2PR15MB3544.namprd15.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3620c88e-1db2-4a2b-10e8-08db47080c61 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Apr 2023 10:13:29.5705 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fcf67057-50c9-4ad4-98f3-ffca64add9e9 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: z7fLpZqArfdjykppnnvH/hTC/C/D0BgFoxRLQvCEK6rOIV34brVRPLpzR9BKEV+hcIeGrLhWKxU9zQ11T7B5kA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR15MB4580 X-Proofpoint-ORIG-GUID: 0P524Io3_g2Uw4OeE8hJ6mhIkZnmtKiH X-Proofpoint-GUID: 0P524Io3_g2Uw4OeE8hJ6mhIkZnmtKiH X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-27_07,2023-04-26_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 spamscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304270087 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Aditya Kamath1 via Gdb-patches Reply-To: Aditya Kamath1 Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi Ulrich, Tom and community, >My understanding, and that is apparently confirmed by the >text in the GNU stabs documentation here: >https://sourceware.org/gdb/download/onlinedocs/stabs/Transformations-On-Gl= obal-Variables.html >is that the "address" va lue in the debug entry is not used, >but the actual address should be taken from the .text entry. >Now I'm not sure why this doesn't work correctly, but this >may be a place to investigate further. >(One interesting thing to note is that the names do not match >exactly, as the .text entry has the leading '.' that is used >on ppc64 ... maybe this throws off some of the stabs logic?) Thank you so much for this explanation. So here is our investigation furthe= r. This __new_exitfn is coming from libgcc. Libgcc is -g compiled with stabs d= ebugging format. bash-5.1$ dump -tov /opt/freeware/lib/libgcc_s.a | grep __new_exitfn [32] m 0x200007e8 .data 1 unamex __new_exi= tfn_called [8978] m 0x100002cc .text 2 extern .__new_ex= itfn [8981] m 0x00000000 debug 0 fun __new_exi= tfn:F1=3D*2=3Dxsexit_function: [9039] m 0x00000000 debug 0 gsym __new_exi= tfn_called:G13=3D14=3D@s64;r14;0;01777777777777777777777; [9053] m 0x20000060 .data 1 extern __new_exi= tfn_called We see that gcc 10 has this debug symbol which is copied in every binary co= mpiled with gcc 10. But if I use gcc 11 whose debug format is dwarf and -g compiled this symbo= l is as below. And I do not see that bug anymore. dump -tov /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/11/libgcc_s.a | grep= __new_exitfn [32] m 0x200007d8 .data 1 unamex __new_exi= tfn_called [2813] m 0x100003e4 .text 2 extern .__new_ex= itfn [2834] m 0x20000050 .data 1 extern __new_exi= tfn_called So folks who will use this version of gcc will not face this problem. So this looks like a gcc problem.. From: Ulrich Weigand Date: Monday, 24 April 2023 at 9:14 PM To: gdb-patches@sourceware.org , Aditya Kamath1= , tom@tromey.com Cc: Sangamesh Mallayya , simon.marchi@efficios.= com Subject: Re: [PATCH] Fix call functions command bug in 64-bit programs for = AIX and PC read in psymtab-symtab warning Aditya Kamath1 wrote: >So here is the thing, there are 4 values for which the psymtab entries are= created. Their addresses are 0, 1a0, 0 and 8. > >In the object dump outputs I see they are like this.. >[235] m 0x00000000 debug 0 gsym __new_ex= itfn_called:G13=3D14=3D@s64;r14;0;01777777777777777777777; >[236] m 0x00000008 debug 0 gsym __exit_f= uncs:G4 >[188] m 0x000001a0 debug 0 fun __intern= al_atexit:F8=3Dr8;-2147483648;2147483647; >[177] m 0x00000000 debug 0 fun __new_ex= itfn:F1=3D*2=3Dxsexit_function: It seems to be these numbers are not actual addresses, which looks like the root cause of the problem. In fact, looking e.g. at "__new_exitfn" in the detailed dump below: >[174] m 0x100007a8 .text 2 extern .__new_e= xitfn >[175] a2 0 416 7670 185 >[176] a4 0x000000ac 0 0 LD PR 0 0 >[177] m 0x00000000 debug 0 fun __new_ex= itfn:F1=3D*2=3Dxsexit_function: >[178] m 0x100007a8 .text 1 fcn .bf >[179] a1 0 75 0 0 0 >[180] m 0x0000001f debug 0 rpsym listp:R3= =3D*4=3D*5=3Dxsexit_function_list: >[181] m 0x00000003 debug 0 rsym r:r1 >[182] m 0x00000009 debug 0 rsym i:r6=3D7= =3Dr7;0;037777777777; >[183] m 0x10000924 .text 1 fcn .ef >[184] a1 0 131 0 0 0 We see that there is an actual symbol (in the .text section) at address 0x100007a8, covering 416 byte (until 0x10000948). *In addition*, there is a "debug" (stabs) symbol giving the type of that function. This also has an address field, but this is simply zero. My understanding, and that is apparently confirmed by the text in the GNU stabs documentation here: https://sourceware.org/gdb/download/onlinedocs/stabs/Transformations-On-Glo= bal-Variables.html is that the "address" value in the debug entry is not used, but the actual address should be taken from the .text entry. Now I'm not sure why this doesn't work correctly, but this may be a place to investigate further. (One interesting thing to note is that the names do not match exactly, as the .text entry has the leading '.' that is used on ppc64 ... maybe this throws off some of the stabs logic?) Bye, Ulrich