From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id E1F6A386FC1B for ; Wed, 23 Jun 2021 15:36:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E1F6A386FC1B Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15NFXcQq021934 for ; Wed, 23 Jun 2021 11:36:36 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 39c5nnway4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 Jun 2021 11:36:36 -0400 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 15NFY2f6023128 for ; Wed, 23 Jun 2021 11:36:36 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 39c5nnwawy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Jun 2021 11:36:36 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15NFXSg4013364; Wed, 23 Jun 2021 15:36:33 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma06ams.nl.ibm.com with ESMTP id 3997uha2uu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Jun 2021 15:36:33 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15NFaVng29426086 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Jun 2021 15:36:31 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5976342045; Wed, 23 Jun 2021 15:36:31 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 454C242042; Wed, 23 Jun 2021 15:36:31 +0000 (GMT) Received: from oc3748833570.ibm.com (unknown [9.145.160.8]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 23 Jun 2021 15:36:31 +0000 (GMT) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id A85EDD801F9; Wed, 23 Jun 2021 17:36:30 +0200 (CEST) Date: Wed, 23 Jun 2021 17:36:30 +0200 From: Ulrich Weigand To: will schmidt , amodra@gmail.com Cc: gdb-patches@sourceware.org, rogerio , "Carl E. Love" Subject: Re: gdb compile for powerpc64 target - Could not find symbol ".TOC." Message-ID: <20210623153630.GA2224@oc3748833570.ibm.com> References: <606184731c3ea9b484a098f393ffd1efd8190fe2.camel@vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <606184731c3ea9b484a098f393ffd1efd8190fe2.camel@vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Proofpoint-GUID: FH-mUdsmUBAat8kR-zWVAeJWPVJ15YWL X-Proofpoint-ORIG-GUID: dvqTvLhgpRkCD0dG8eDeo62NnzT8M2ND X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-06-23_09:2021-06-23, 2021-06-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 mlxlogscore=938 malwarescore=0 phishscore=0 lowpriorityscore=0 adultscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106230090 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, RCVD_IN_MSPIKE_BL, RCVD_IN_MSPIKE_L3, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 23 Jun 2021 15:36:39 -0000 On Tue, Jun 22, 2021 at 01:54:56PM -0500, will schmidt wrote: > During gdb/compile/compile-object-load.c: > compile-object-load() the following is emitted: > warning: Could not find symbol ".TOC." for compiled module > "/tmp/gdbobj-wIKWtk/out15.o". > > My best guess is that we need to incorporate some amount of special > handling for the TOC entry to help find the symbols we are after. > But.. I havn't stumbled across anything similar for other targets, and > I havn't yet gleamed enlightenment looking at the existing code in > compile-object-load. :-) As a hack I have tried treating the > TOC symbol like we do the GOT entry, those attempts will later crash as > we will trip over a zero dereference when trying to get at the symbol > to print it. Yes, we probably do need a proper value for .TOC. Usually, this is set by the linker to 0x8000 bytes after the beginning of the .toc section, I think. Looks like there is a BFD routine ppc64_elf_set_toc that will define that symbol, but that's probably never called here if you just load a plain object file. Alan, do you have any suggestions of how to handle this, maybe? > With "set debug compile" enabled, a few bits of possibly relevant > info.. > > COLLECT_GCC_OPTIONS='-m64' '-mcmodel=large' '-A' 'system=linux' Can you try without -mcmodel=large ? The particular reference to the .TOC. symbol you show below originated from this option. However, even without that there may still be references to .TOC. Bye, Ulricj -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com