From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24702 invoked by alias); 10 Oct 2016 16:29:02 -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 24693 invoked by uid 89); 10 Oct 2016 16:29:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1371 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; Mon, 10 Oct 2016 16:29:00 +0000 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9AGRHP2062194 for ; Mon, 10 Oct 2016 12:28:58 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 260dj6tm43-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 10 Oct 2016 12:28:58 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Oct 2016 17:28:57 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 10 Oct 2016 17:28:56 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9237C1B08023 for ; Mon, 10 Oct 2016 17:30:55 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9AGStKA13697320 for ; Mon, 10 Oct 2016 16:28:55 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u9AGStB1008410 for ; Mon, 10 Oct 2016 10:28:55 -0600 Received: from oc8523832656.ibm.com (icon-9-164-136-187.megacenter.de.ibm.com [9.164.136.187]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u9AGStWR008398; Mon, 10 Oct 2016 10:28:55 -0600 Received: by oc8523832656.ibm.com (Postfix, from userid 500) id BEB9D10C212; Mon, 10 Oct 2016 18:28:53 +0200 (CEST) Subject: Re: set sysroot command on AIX has no effect. To: sangamesh.swamy@in.ibm.com (Sangamesh Mallayya) Date: Mon, 10 Oct 2016 16:29:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: from "Sangamesh Mallayya" at Oct 10, 2016 05:41:21 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: 16101016-0020-0000-0000-0000025DF66A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16101016-0021-0000-0000-00003E86F613 Message-Id: <20161010162853.BEB9D10C212@oc8523832656.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-10_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=1 spamscore=1 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610100275 X-SW-Source: 2016-10/txt/msg00222.txt.bz2 Sangamesh Mallayya wrote: > Here is the change i have it right now which takes care of. > > 1) calling solib_find and then solib_bfd_fopen. > 2) Appending parenthesized member name. This is looking mostly good. The one thing I don't like is all the extra xfree calls. I think a better way would to not actually xstrdup the found pathname early after all, but instead just get it from the BFD. So instead of the original: xfree (bfd_get_filename (object_bfd)); object_bfd->filename = xstrdup (pathname); you'd do something like: object_bfd->filename = xrealloc (object_bfd->filename, ...); strcat (object_bfd->filename, sep); > + /* Calling solib_find makes certain that sysroot path is set properly > + if program has a dependency on .a archive and sysroot is set via > + set sysroot command */ Minor coding style issue: sentences in a comment should end with a '.' followed by two spaces, like so: ... set sysroot command. */ > + found_pathname1 = xstrdup (found_pathname); > + found_path_len = strlen (found_pathname1) + strlen (sep); > + found_pathname1 = xrealloc (found_pathname1, found_path_len); See comment above, but also: there should be a "+ 1" for the null terminator in the length computation somewhere. Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com