From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112946 invoked by alias); 30 Sep 2016 14:15:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 112935 invoked by uid 89); 30 Sep 2016 14:15:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1425 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Sep 2016 14:15:14 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8UEDsAi076016 for ; Fri, 30 Sep 2016 10:15:13 -0400 Received: from e06smtp06.uk.ibm.com (e06smtp06.uk.ibm.com [195.75.94.102]) by mx0b-001b2d01.pphosted.com with ESMTP id 25squun9n1-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 30 Sep 2016 10:15:12 -0400 Received: from localhost by e06smtp06.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Sep 2016 15:15:11 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp06.uk.ibm.com (192.168.101.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 30 Sep 2016 15:15:06 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id A93F417D805A for ; Fri, 30 Sep 2016 15:17:08 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u8UEF5Up15008112 for ; Fri, 30 Sep 2016 14:15:05 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u8UEF5mo031637 for ; Fri, 30 Sep 2016 08:15:05 -0600 Received: from oc8523832656.ibm.com (dyn-9-152-213-24.boeblingen.de.ibm.com [9.152.213.24]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u8UEF3BE031567; Fri, 30 Sep 2016 08:15:04 -0600 Received: by oc8523832656.ibm.com (Postfix, from userid 500) id 698BC11C24D; Fri, 30 Sep 2016 16:15:03 +0200 (CEST) Subject: Re: set sysroot command on AIX has no effect. To: sangamesh.swamy@in.ibm.com (Sangamesh Mallayya) Date: Fri, 30 Sep 2016 14:38:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: from "Sangamesh Mallayya" at Sep 30, 2016 07:38:48 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16093014-0024-0000-0000-0000022A2A8D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16093014-0025-0000-0000-0000209F47F3 Message-Id: <20160930141503.698BC11C24D@oc8523832656.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-30_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609280000 definitions=main-1609300259 X-SW-Source: 2016-09/txt/msg00428.txt.bz2 Hi Sangamesh, > If we call solib_bfd_open for .a files then the call to open file using > gdb_open_cloexec inside solib_find function is failing. > The reason for this is, > we will be getting library information from ld_info in the form of > "/usr/lib/libc.a(shr.o)", but actually we will be having the > file in filesystem as /usr/lib/libc.a. This is the reason initially i > didn't use solib_bfd_open. Yes, I understand why you cannot use solib_bfd_open directly. That's why I suggested to use *solib_bfd_fopen* (note the "f") :-) > But i experimented some more and tried to see how gdb behaves if we pass > modified pathname exactly as the file which we are having in the machine, > like "/usr/lib/libc.a". > Then bfd bfd_check_format is failing with the error "not in executable > format". > Looks like bfd isn't able to recognise the .a archives. > I can have a look on why bfd check is failing. That's because solib_bfd_open uses the bfd_object argument to bfd_check_format, which is explicitly supposed to reject .a archives. Instead, to check for archives, you need to use bfd_archive, like solib_aix_bfd_open does. I'm not suggesting to change that, just to open the bfd using solib_find and solib_bfd_fopen before performing the check, instead of using gdb_bfd_open. Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com