From patchwork Thu Dec 7 01:35:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Merey X-Patchwork-Id: 81563 X-Patchwork-Delegate: amerey@redhat.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 31E67385AC3E for ; Thu, 7 Dec 2023 01:35:30 +0000 (GMT) X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5C17C3858C2A for ; Thu, 7 Dec 2023 01:35:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C17C3858C2A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5C17C3858C2A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701912923; cv=none; b=PP0YflXeTkMqrnAep2k1ubpvSzACt7bojSBFKJggx9bRJhxJsUYFGgdx8sXMXwgO6FIl3LhMNH93EPz3rb4np95aXAo7btRFvpDAOnwbcvcVFrathO+xyEOQAJ/YQDj037mtukwikgu+yCxTvq296pYBVusAgAF2jXXipaW4mI0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701912923; c=relaxed/simple; bh=z9XsX1TxBrk/ybLzjaDOajwXArldrCGH4LJ0YZJP2L0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HLOz8/H11SWIpvTHsQ53hKa1YxQtWfGQsCeFIFnWQVOkKxUUErYSt3asnb2FEYtltHLQZxIzfYsOPijEO0jhMddfvpFkUX/KyxF3XNM4lG8MusCliRvHyDL/lg6npAlGlDkUkJdFP9N1szPedzi0HWj6SHz+9zczv9SNelGP4tM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701912922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dfIbq5cma2tpL279ClbyS4klE+JO/cxYd4eenbBQSyk=; b=fH8Q4lbgqS702LuX27Sf3OtXlN9wrDgS0MwJf3vm0gUx7G85uFHVa8HVqzeLtuR5PyXfM1 SR4xC4/d5PyB/CiixKn4kzYGk7QmSACAqLv7W5OmREQFRaGxlTF/5mxCWsbqDckbTCbKy+ BrFgRIb2AU60a0mNvfdTygOOUyg+gOU= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-310-QvfDv6noNey4gdg0S5jR3A-1; Wed, 06 Dec 2023 20:35:20 -0500 X-MC-Unique: QvfDv6noNey4gdg0S5jR3A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 428CB283780F for ; Thu, 7 Dec 2023 01:35:20 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.16.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF08D1C060AF; Thu, 7 Dec 2023 01:35:19 +0000 (UTC) From: Aaron Merey To: elfutils-devel@sourceware.org Cc: Aaron Merey Subject: [PATCH 1/2] libdw: Use INTUSE with dwarf_get_units Date: Wed, 6 Dec 2023 20:35:03 -0500 Message-ID: <20231207013504.40300-2-amerey@redhat.com> In-Reply-To: <20231207013504.40300-1-amerey@redhat.com> References: <20231207013504.40300-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 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_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Add INTDECL for dwarf_get_units and call dwarf_get_units with INTUSE. Signed-off-by: Aaron Merey --- libdw/dwarf_get_units.c | 1 + libdw/dwarf_next_lines.c | 8 +-- libdw/libdwP.h | 91 +++++++++++++++++------------------ libdw/libdw_find_split_unit.c | 4 +- 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/libdw/dwarf_get_units.c b/libdw/dwarf_get_units.c index 6215bf4b..407ed2ba 100644 --- a/libdw/dwarf_get_units.c +++ b/libdw/dwarf_get_units.c @@ -129,3 +129,4 @@ dwarf_get_units (Dwarf *dwarf, Dwarf_CU *cu, Dwarf_CU **next_cu, return 0; } +INTDEF(dwarf_get_units) diff --git a/libdw/dwarf_next_lines.c b/libdw/dwarf_next_lines.c index 9b76b47e..74854ecd 100644 --- a/libdw/dwarf_next_lines.c +++ b/libdw/dwarf_next_lines.c @@ -99,8 +99,8 @@ dwarf_next_lines (Dwarf *dbg, Dwarf_Off off, Dwarf_CU *given_cu = *cu; Dwarf_CU *next_cu = given_cu; bool found = false; - while (dwarf_get_units (dbg, next_cu, &next_cu, NULL, NULL, - &cudie, NULL) == 0) + while (INTUSE(dwarf_get_units) (dbg, next_cu, &next_cu, NULL, NULL, + &cudie, NULL) == 0) { if (dwarf_hasattr (&cudie, DW_AT_stmt_list)) { @@ -131,8 +131,8 @@ dwarf_next_lines (Dwarf *dbg, Dwarf_Off off, tables. Need to do a linear search (but stop at the given CU, since we already searched those. */ next_cu = NULL; - while (dwarf_get_units (dbg, next_cu, &next_cu, NULL, NULL, - &cudie, NULL) == 0 + while (INTUSE(dwarf_get_units) (dbg, next_cu, &next_cu, NULL, NULL, + &cudie, NULL) == 0 && next_cu != given_cu) { Dwarf_Attribute attr; diff --git a/libdw/libdwP.h b/libdw/libdwP.h index aef42267..5aca9082 100644 --- a/libdw/libdwP.h +++ b/libdw/libdwP.h @@ -414,6 +414,49 @@ struct Dwarf_CU void *endp; }; +/* Aliases to avoid PLTs. */ +INTDECL (dwarf_aggregate_size) +INTDECL (dwarf_attr) +INTDECL (dwarf_attr_integrate) +INTDECL (dwarf_begin) +INTDECL (dwarf_begin_elf) +INTDECL (dwarf_child) +INTDECL (dwarf_default_lower_bound) +INTDECL (dwarf_dieoffset) +INTDECL (dwarf_diename) +INTDECL (dwarf_end) +INTDECL (dwarf_entrypc) +INTDECL (dwarf_errmsg) +INTDECL (dwarf_formaddr) +INTDECL (dwarf_formblock) +INTDECL (dwarf_formref_die) +INTDECL (dwarf_formsdata) +INTDECL (dwarf_formstring) +INTDECL (dwarf_formudata) +INTDECL (dwarf_getabbrevattr_data) +INTDECL (dwarf_getalt) +INTDECL (dwarf_getarange_addr) +INTDECL (dwarf_getarangeinfo) +INTDECL (dwarf_getaranges) +INTDECL (dwarf_getlocation_die) +INTDECL (dwarf_getsrcfiles) +INTDECL (dwarf_getsrclines) +INTDECL (dwarf_get_units) +INTDECL (dwarf_hasattr) +INTDECL (dwarf_haschildren) +INTDECL (dwarf_haspc) +INTDECL (dwarf_highpc) +INTDECL (dwarf_lowpc) +INTDECL (dwarf_nextcu) +INTDECL (dwarf_next_unit) +INTDECL (dwarf_offdie) +INTDECL (dwarf_peel_type) +INTDECL (dwarf_ranges) +INTDECL (dwarf_setalt) +INTDECL (dwarf_siblingof) +INTDECL (dwarf_srclang) +INTDECL (dwarf_tag) + #define ISV4TU(cu) ((cu)->version == 4 && (cu)->sec_idx == IDX_debug_types) /* Compute the offset of a CU's first DIE from the CU offset. @@ -1061,8 +1104,8 @@ str_offsets_base_off (Dwarf *dbg, Dwarf_CU *cu) if (cu == NULL && dbg != NULL) { Dwarf_CU *first_cu; - if (dwarf_get_units (dbg, NULL, &first_cu, - NULL, NULL, NULL, NULL) == 0) + if (INTUSE(dwarf_get_units) (dbg, NULL, &first_cu, + NULL, NULL, NULL, NULL) == 0) cu = first_cu; } @@ -1379,48 +1422,4 @@ void __libdw_set_debugdir (Dwarf *dbg); char * __libdw_filepath (const char *debugdir, const char *dir, const char *file) internal_function; - - -/* Aliases to avoid PLTs. */ -INTDECL (dwarf_aggregate_size) -INTDECL (dwarf_attr) -INTDECL (dwarf_attr_integrate) -INTDECL (dwarf_begin) -INTDECL (dwarf_begin_elf) -INTDECL (dwarf_child) -INTDECL (dwarf_default_lower_bound) -INTDECL (dwarf_dieoffset) -INTDECL (dwarf_diename) -INTDECL (dwarf_end) -INTDECL (dwarf_entrypc) -INTDECL (dwarf_errmsg) -INTDECL (dwarf_formaddr) -INTDECL (dwarf_formblock) -INTDECL (dwarf_formref_die) -INTDECL (dwarf_formsdata) -INTDECL (dwarf_formstring) -INTDECL (dwarf_formudata) -INTDECL (dwarf_getabbrevattr_data) -INTDECL (dwarf_getalt) -INTDECL (dwarf_getarange_addr) -INTDECL (dwarf_getarangeinfo) -INTDECL (dwarf_getaranges) -INTDECL (dwarf_getlocation_die) -INTDECL (dwarf_getsrcfiles) -INTDECL (dwarf_getsrclines) -INTDECL (dwarf_hasattr) -INTDECL (dwarf_haschildren) -INTDECL (dwarf_haspc) -INTDECL (dwarf_highpc) -INTDECL (dwarf_lowpc) -INTDECL (dwarf_nextcu) -INTDECL (dwarf_next_unit) -INTDECL (dwarf_offdie) -INTDECL (dwarf_peel_type) -INTDECL (dwarf_ranges) -INTDECL (dwarf_setalt) -INTDECL (dwarf_siblingof) -INTDECL (dwarf_srclang) -INTDECL (dwarf_tag) - #endif /* libdwP.h */ diff --git a/libdw/libdw_find_split_unit.c b/libdw/libdw_find_split_unit.c index 533f8072..34e29e9d 100644 --- a/libdw/libdw_find_split_unit.c +++ b/libdw/libdw_find_split_unit.c @@ -51,8 +51,8 @@ try_split_file (Dwarf_CU *cu, const char *dwo_path) if (split_dwarf != NULL) { Dwarf_CU *split = NULL; - while (dwarf_get_units (split_dwarf, split, &split, - NULL, NULL, NULL, NULL) == 0) + while (INTUSE(dwarf_get_units) (split_dwarf, split, &split, + NULL, NULL, NULL, NULL) == 0) { if (split->unit_type == DW_UT_split_compile && cu->unit_id8 == split->unit_id8)