From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0CE6F158086 for ; Mon, 1 Nov 2021 17:32:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5F58CE07F1; Mon, 1 Nov 2021 17:32:18 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 473C9E07F1 for ; Mon, 1 Nov 2021 17:32:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 21DF5342E01 for ; Mon, 1 Nov 2021 17:32:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 583D4165 for ; Mon, 1 Nov 2021 17:32:15 +0000 (UTC) From: "Mike Gilbert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Gilbert" Message-ID: <1635705864.77288903dfbc98a0d707fd8093d3b2b55ee049e6.floppym@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/estrip X-VCS-Directories: bin/ X-VCS-Committer: floppym X-VCS-Committer-Name: Mike Gilbert X-VCS-Revision: 77288903dfbc98a0d707fd8093d3b2b55ee049e6 X-VCS-Branch: master Date: Mon, 1 Nov 2021 17:32:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3939a1ca-554b-41dd-841f-74ac1045445f X-Archives-Hash: 565b2dd3b049350b27ad93b2b2edc0c9 commit: 77288903dfbc98a0d707fd8093d3b2b55ee049e6 Author: Mike Gilbert gentoo org> AuthorDate: Sun Oct 31 18:43:17 2021 +0000 Commit: Mike Gilbert gentoo org> CommitDate: Sun Oct 31 18:44:24 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=77288903 estrip: skip build-id link creation if we fail to create a debug file Signed-off-by: Mike Gilbert gentoo.org> bin/estrip | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/bin/estrip b/bin/estrip index e33977091..050d30a6f 100755 --- a/bin/estrip +++ b/bin/estrip @@ -243,23 +243,24 @@ save_elf_debug() { chmod ${args} "${dst}" # symlink so we can read the name back. ln -s "${dst}" "${inode_debug}" || die + + # if we don't already have build-id from debugedit, look it up + if [[ -z ${buildid} ]] ; then + # convert the readelf output to something useful + buildid=$(${READELF} -n "${src}" 2>/dev/null | awk '/Build ID:/{ print $NF; exit }') + fi + if [[ -n ${buildid} ]] ; then + local buildid_dir="${ED%/}/usr/lib/debug/.build-id/${buildid:0:2}" + local buildid_file="${buildid_dir}/${buildid:2}" + local src_buildid_rel="../../../../../${src#${ED%/}/}" + local dst_buildid_rel="../../${dst#${ED%/}/usr/lib/debug/}" + mkdir -p "${buildid_dir}" || die + [[ -L "${buildid_file}".debug ]] || ln -s "${dst_buildid_rel}" "${buildid_file}.debug" || die + [[ -L "${buildid_file}" ]] || ln -s "${src_buildid_rel}" "${buildid_file}" || die + fi fi fi - # if we don't already have build-id from debugedit, look it up - if [[ -z ${buildid} ]] ; then - # convert the readelf output to something useful - buildid=$(${READELF} -n "${src}" 2>/dev/null | awk '/Build ID:/{ print $NF; exit }') - fi - if [[ -n ${buildid} ]] ; then - local buildid_dir="${ED%/}/usr/lib/debug/.build-id/${buildid:0:2}" - local buildid_file="${buildid_dir}/${buildid:2}" - local src_buildid_rel="../../../../../${src#${ED%/}/}" - local dst_buildid_rel="../../${dst#${ED%/}/usr/lib/debug/}" - mkdir -p "${buildid_dir}" - [[ -L "${buildid_file}".debug ]] || ln -s "${dst_buildid_rel}" "${buildid_file}.debug" - [[ -L "${buildid_file}" ]] || ln -s "${src_buildid_rel}" "${buildid_file}" - fi } # Usage: process_elf