From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1AFD43858D3C for ; Tue, 21 Feb 2023 11:15:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1AFD43858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676978105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=5h3AOJ4U8xEpWCqckQje1y6j6KEDakgk+7f3O2666iM=; b=P9wzm9LepBSot0S+xuCqX7SAxX0AM8OlTF7KtDSr1YiQTkFZYGt4QzvpCw/kp/reaOag6T yyXecVs5AZ45Tn5MPLOEfpWF4njWnLm2bDppMUhsGi2gcLwL/DY4TUv2k0xLNP93QIBTUt 80tqAjrjZ4652fBKtd6XcyDsgx2f4Gs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-21-WTlISLxmMYOU9xoCN21sIw-1; Tue, 21 Feb 2023 06:15:04 -0500 X-MC-Unique: WTlISLxmMYOU9xoCN21sIw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F34BD101B42B for ; Tue, 21 Feb 2023 11:15:03 +0000 (UTC) Received: from prancer.redhat.com (unknown [10.33.36.208]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7925492B01 for ; Tue, 21 Feb 2023 11:15:03 +0000 (UTC) From: Nick Clifton To: binutils@sourceware.org Subject: Commit: Update description of bfd_fill_in_gnu_debuglink_section Date: Tue, 21 Feb 2023 11:14:58 +0000 Message-ID: <87v8jv9snh.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Guys, I am checking in the patch below to update the description of the bfd_fill_in_gnu_debuglink_section function - which will perfectly file with both relative filepaths and absolute filepaths. The patch also fixes a comment, since the path to the binary file is not significant for the link that is actually stored in the .gnu_debuglink section. Cheers Nick diff --git a/bfd/opncls.c b/bfd/opncls.c index 4d0ca48ee78..5dacad9b7d4 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -1706,8 +1706,8 @@ SYNOPSIS DESCRIPTION Takes a @var{BFD} and containing a .gnu_debuglink section @var{SECT} and fills in the contents of the section to contain a link to the - specified @var{filename}. The filename should be relative to the - current directory. + specified @var{filename}. The filename should be absolute or + relative to the current directory. <> is returned if all is ok. Otherwise <> is returned and bfd_error is set. @@ -1733,12 +1733,7 @@ bfd_fill_in_gnu_debuglink_section (bfd *abfd, return false; } - /* Make sure that we can read the file. - XXX - Should we attempt to locate the debug info file using the same - algorithm as gdb ? At the moment, since we are creating the - .gnu_debuglink section, we insist upon the user providing us with a - correct-for-section-creation-time path, but this need not conform to - the gdb location algorithm. */ + /* Open the linked file so that we can compute a CRC. */ handle = _bfd_real_fopen (filename, FOPEN_RB); if (handle == NULL) {