From patchwork Mon Jun 9 16:24:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Merey X-Patchwork-Id: 114057 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 88A92383068A for ; Mon, 9 Jun 2025 16:25:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 88A92383068A Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fbdN1Yu2 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.129.124]) by sourceware.org (Postfix) with ESMTP id E1ABB3830685 for ; Mon, 9 Jun 2025 16:24:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E1ABB3830685 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine 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 E1ABB3830685 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749486290; cv=none; b=oLQe7eMypdmtGCPLrMNbXMscvKEqAatpFstYpwgKRHsl99NUjyt2LqlUGDz2OVOHUOTQEo5KufkkcpXAsAELxyhe697PkGJbiIiJvgUukuSk1eojz1+C6SJKAh9zlQYW2fqyj9tYVYymtOVXbY4OiElKm5Uz9/zMt/sGZpfuJ8E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749486290; c=relaxed/simple; bh=Yr2diiioCoplj2b8kRqXW4wmDweadCDTJc4P9M7T8ds=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=YTtrCpEs7j6htn0afe9vpYvUSn4ym2tFz4hSzJAeOFJ+Cw5+86BCKMoSmAOdWxXmfJjhoCW/RVO/VSJB0P/acLXx9uGOxNPPiXAbhoTij/tr6qmLCaL/qrTlpv3Svs3exxKTnAJQBLa795XPfYnohD9A7Ind2dAuQJ1XaPGdvG0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E1ABB3830685 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749486289; 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; bh=oRFZv/Qzd5WmL6TEeSBILj9FbR5mHrNAUOakrdBOPyM=; b=fbdN1Yu2Q/4J84XVdNxp75cQx9f4CBHOaeMJA239rNYmZto5Cku6MtkCy7xiIN5rKPKnpo shrSxYH7Zg+S31BIx6+/AZ1x08XZHexlD/8DM9hYkQtcCJYtxaFGqEch65S7MyFzViduHD IVge/tS8LBaXNQUQhrVwaVB6N+ss6k0= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-641-f6S3ioM0Ngal1NHLPYoT5A-1; Mon, 09 Jun 2025 12:24:48 -0400 X-MC-Unique: f6S3ioM0Ngal1NHLPYoT5A-1 X-Mimecast-MFC-AGG-ID: f6S3ioM0Ngal1NHLPYoT5A_1749486287 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AB5E2180029F for ; Mon, 9 Jun 2025 16:24:47 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.89.91]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0CF0119560AB; Mon, 9 Jun 2025 16:24:46 +0000 (UTC) From: Aaron Merey To: elfutils-devel@sourceware.org Cc: Aaron Merey Subject: [PATCH 1/4] doc: Add elf_next.3 Date: Mon, 9 Jun 2025 12:24:36 -0400 Message-ID: <20250609162439.89825-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 5g0UmUSBzosGhE8usisORY29rYvUn9z9-eyJcWskBHA_1749486287 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.8 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_H5, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, 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 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 Signed-off-by: Aaron Merey --- doc/Makefile.am | 1 + doc/elf_next.3 | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 doc/elf_next.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 1ced7858..fbfebfe0 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -61,6 +61,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ elf_hash.3 \ elf_kind.3 \ elf_ndxscn.3 \ + elf_next.3 \ elf_update.3 \ elf_version.3 \ libelf.3 diff --git a/doc/elf_next.3 b/doc/elf_next.3 new file mode 100644 index 00000000..fb691bce --- /dev/null +++ b/doc/elf_next.3 @@ -0,0 +1,66 @@ +.TH ELF_NEXT 3 2025-06-06 "Libelf" "Libelf Programmer's Manual" + +.SH NAME +elf_next \- advance an Elf descriptor to the next archive member +.SH SYNOPSIS +.nf +.B #include + +.BI "Elf_Cmd elf_next(Elf *" elf ");" +.fi +.SH DESCRIPTION +Advance an ELF descriptor associated with an archive file to the next available +archive member. + +.P +If +.I elf +was initialized from an archive file, +.B elf_next() +updates +.I elf +to refer to the next ELF object in the archive. If +.I elf +was not initialized from an archive file, then this function makes no changes to +.I elf. + +.SH RETURN VALUE +If +.I elf +refers to an archive and another member is available, update the state of +.I elf +is updated so that it refers to the next archive member and return the +.B Elf_Cmd +that was used with +.B elf_begin +to initialize +.IR elf . + +.P +If +.I elf +was not initialized from an archive file or there are no more archive members, +.B elf_next() +returns +.B ELF_C_NULL. + +.SH SEE ALSO +.BR elf_begin (3), +.BR libelf (3), +.BR elf (5) + +.SH ATTRIBUTES +.TS +allbox; +lbx lb lb +l l l. +Interface Attribute Value +T{ +.na +.nh +.BR elf_next () +T} Thread safety MT-Safe +.TE + +.SH REPORTING BUGS +Report bugs to or https://sourceware.org/bugzilla/. From patchwork Mon Jun 9 16:24:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Merey X-Patchwork-Id: 114058 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 405D93830687 for ; Mon, 9 Jun 2025 16:25:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 405D93830687 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=aCwRE4Wo 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 ESMTP id A16B63830683 for ; Mon, 9 Jun 2025 16:24:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A16B63830683 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine 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 A16B63830683 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=1749486292; cv=none; b=lRfL4unLeweByrmJmxGukOX8idPPr3SCMZ+q5hhZ/piikhJ0jkSl+GheL9KJZ8quLQ22BETmWwvyBmLcpn0Ykcoi862jJq/vz4B6e9AWyB0Mwc5JRggtf3yuCwGClyHd+EOUQY2MXSE3OEKdYblj52/20Z1CcgHODhYZkfjIJUs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749486292; c=relaxed/simple; bh=KdsYhm4tLcYR1DlEFAJUZZmbxVZed7Qc8F+2XkY9KzU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZTk1E+nlxT5vqYVi7AIZksG1yhQT3E6zzOqjgCDQlL47t3CQXXFYVrIiw/HNuQc80PbIrMusXYrBFsP2VNjGb2b7i6kDeDW2ta02rrBm6nPkg+TGM/MNpgCOthE9sazavD7aOPVP2Q2+cwh8Sy/3XwB1I2rEHdaVybQStLomMHk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A16B63830683 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749486292; 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=bCbDzn50rXkdF2WvXXH10M1feqDEOvyRKvyfcys141Q=; b=aCwRE4WogiXJzJ7gpYeBxWUYI4oQMl0pYUkRs/1JfCT+NCsJV635fIZnWkY+esMaE9ygkU M+G5YGg5oPoO2OLKuZZ9A5wXUMN7KHcrdJ8OPgoHNDV1Lad73OnJc2UD5bAKESlIPwya7W 9Nlm4cboybshvvMwQl6xXdoEgjHZ3wM= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-642-saWxgx29OBSj6KDJ5MifSQ-1; Mon, 09 Jun 2025 12:24:51 -0400 X-MC-Unique: saWxgx29OBSj6KDJ5MifSQ-1 X-Mimecast-MFC-AGG-ID: saWxgx29OBSj6KDJ5MifSQ_1749486290 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6CA141808984 for ; Mon, 9 Jun 2025 16:24:50 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.89.91]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A82C819560A3; Mon, 9 Jun 2025 16:24:49 +0000 (UTC) From: Aaron Merey To: elfutils-devel@sourceware.org Cc: Aaron Merey Subject: [PATCH 2/4] doc: Add elf_getaroff.3 Date: Mon, 9 Jun 2025 12:24:37 -0400 Message-ID: <20250609162439.89825-2-amerey@redhat.com> In-Reply-To: <20250609162439.89825-1-amerey@redhat.com> References: <20250609162439.89825-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: -WA7hcuCvRbPKdtGf-zdbMNu8u28E02QOeylauDZ4sI_1749486290 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.8 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_H5, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, 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 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 Signed-off-by: Aaron Merey --- doc/Makefile.am | 1 + doc/elf_getaroff.3 | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 doc/elf_getaroff.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index fbfebfe0..6451ffab 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -55,6 +55,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ elf_errmsg.3 \ elf_errno.3 \ elf_fill.3 \ + elf_getaroff.3 \ elf_getbase.3 \ elf_getdata.3 \ elf_getscn.3 \ diff --git a/doc/elf_getaroff.3 b/doc/elf_getaroff.3 new file mode 100644 index 00000000..05072ad5 --- /dev/null +++ b/doc/elf_getaroff.3 @@ -0,0 +1,55 @@ +.TH ELF_GETAROFF 3 2025-06-06 "Libelf" "Libelf Programmer's Manual" + +.SH NAME +elf_getaroff \- retrieve the offset of an archive member + +.SH SYNOPSIS +.nf +.B #include + +.BI "int64_t elf_getaroff(Elf *" elf ");" +.fi +.SH DESCRIPTION +Return the file offset, in bytes, of the archive member currently +referred to by an ELF descriptor. + +.SH PARAMETERS +.TP +.I elf +Elf descriptor referring to a member of an archive file. + +.SH RETURN VALUE +Return the file offset, in bytes, of the archive member referred to by +.IR elf . +If +.I elf +is NULL or is not a member of an archive, +return +.BR ELF_C_NULL . + +.SH SEE ALSO +.BR elf_begin (3), +.BR elf_next (3), +.BR libelf (3), +.BR elf (5) + +.SH ATTRIBUTES +.TS +allbox; +lbx lb lb +l l l. +Interface Attribute Value +T{ +.na +.nh +.BR elf_getaroff () +T} Thread safety MT-Safe +.TE + +.SH REPORTING BUGS +Report bugs to or https://sourceware.org/bugzilla/. + +.SH HISTORY +.B elf_getaroff +first appeared in elfutils 0.114. This elfutils libelf function may not be +found in other libelf implementations. From patchwork Mon Jun 9 16:24:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Merey X-Patchwork-Id: 114060 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 D7AD0383068D for ; Mon, 9 Jun 2025 16:26:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D7AD0383068D Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AD3PuCal 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.129.124]) by sourceware.org (Postfix) with ESMTP id C0FCD3830689 for ; Mon, 9 Jun 2025 16:24:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C0FCD3830689 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine 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 C0FCD3830689 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749486294; cv=none; b=BaLosXZA/ep/KsqG1t0yU9RCotx6iuPCfE8pKTFAC4PqVyo5I2kOOM7rMwuIqqZQWPxTzKM6lEaI00xNJWg80r7aF55ubvPphhgkbbOFbbsUt6+ToMHMWS+ybRnmp+gx3RELSjagfIm8xmyLRxpIJxcH3LVctFice9WGHeW6YXc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749486294; c=relaxed/simple; bh=pcz5vkmRaa8p3L+HQp4RHygvotf9cYX77cYWQZ7IySQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=v7hBsQMUGfsG3rHrTn40Y7VfRHw2G6640y0wVRnRY81VLiPM8+REifq26C9XlnBWWvTC9YWc/ESWmPxVV5qJd2z04gXPLE9fJXrogmK1PJlksp3AHgZOq9uyS2addNmgKOnzOA6L5yIHjlBC/3/71BAP6laMc8eLiDCyfXRYuD0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0FCD3830689 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749486294; 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=18u8d5yM3xBRerKG0H3xHnDzwQnqHOx585SVIEARTE4=; b=AD3PuCalAoteSnJeZbafr5jwTHvk4MyEKyjqOHO5ItURncje1NLZ9Oib9DEA2J6vMPsdIS YXvxvoWZ5M2Mt53YqC1u43OvPNDkWtoXW02YDMxIqZjnAAce5hvZcFN75b9CASUDWhXiwl 9TlbAmIYue//GSwB6r74Ogr6xbTHJi8= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-687-bNsuuCmzN92uZNJ0YpMqzw-1; Mon, 09 Jun 2025 12:24:53 -0400 X-MC-Unique: bNsuuCmzN92uZNJ0YpMqzw-1 X-Mimecast-MFC-AGG-ID: bNsuuCmzN92uZNJ0YpMqzw_1749486292 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 90EC519560AA for ; Mon, 9 Jun 2025 16:24:52 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.89.91]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9030A19560A3; Mon, 9 Jun 2025 16:24:51 +0000 (UTC) From: Aaron Merey To: elfutils-devel@sourceware.org Cc: Aaron Merey Subject: [PATCH 3/4] doc: Add elf_getarhdr.3 Date: Mon, 9 Jun 2025 12:24:38 -0400 Message-ID: <20250609162439.89825-3-amerey@redhat.com> In-Reply-To: <20250609162439.89825-1-amerey@redhat.com> References: <20250609162439.89825-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: zeMO1SrlajalSBAW3hLp2qlqXO8hKaioFZ-Jl5re65w_1749486292 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true 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_H5, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, 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 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 Signed-off-by: Aaron Merey --- doc/Makefile.am | 1 + doc/elf_getarhdr.3 | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 doc/elf_getarhdr.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 6451ffab..aae29ebc 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -55,6 +55,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ elf_errmsg.3 \ elf_errno.3 \ elf_fill.3 \ + elf_getarhdr.3 \ elf_getaroff.3 \ elf_getbase.3 \ elf_getdata.3 \ diff --git a/doc/elf_getarhdr.3 b/doc/elf_getarhdr.3 new file mode 100644 index 00000000..5dcedf89 --- /dev/null +++ b/doc/elf_getarhdr.3 @@ -0,0 +1,76 @@ +.TH ELF_GETARHDR 3 2025-06-06 "Libelf" "Libelf Programmer's Manual" + +.SH NAME +elf_getarhdr \- retrieve archive member header information + +.SH SYNOPSIS +.nf +.B #include + +.BI "Elf_Arhdr *elf_getarhdr(Elf *" elf ");" +.fi + +.SH DESCRIPTION +Return a +.B Elf_Arhdr * +describing the archive header of the archive member currently referred +to by an ELF descriptor. + +The +.B Elf_Arhdr +structure is defined as: + +.P +.nf +typedef struct { + char *ar_name; /* Name of archive member. */ + time_t ar_date; /* File date. */ + uid_t ar_uid; /* User ID. */ + gid_t ar_gid; /* Group ID. */ + mode_t ar_mode; /* File mode. */ + int64_t ar_size; /* File size. */ + char *ar_rawname; /* Original name of archive member. */ +} Elf_Arhdr; +.fi + +.SH PARAMETERS +.TP +.I elf +An ELF descriptor referring to a member of an archive file. + +.SH RETURN VALUE +If +.I elf +refers to an archive member, +.B elf_getarhdr() +returns a pointer to its archive header. This pointer is valid only until +.BR elf_next (3) +or +.BR elf_end (3) +is called on the descriptor. If +.I elf +does not refer to an archive member or the header cannot be +acquired then NULL is returned. + +.SH SEE ALSO +.BR elf_begin (3), +.BR elf_getaroff (3), +.BR elf_next (3), +.BR libelf (3), +.BR elf (5) + +.SH ATTRIBUTES +.TS +allbox; +lbx lb lb +l l l. +Interface Attribute Value +T{ +.na +.nh +.BR elf_getarhdr () +T} Thread safety MT-Safe +.TE + +.SH REPORTING BUGS +Report bugs to or https://sourceware.org/bugzilla/. From patchwork Mon Jun 9 16:24:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Merey X-Patchwork-Id: 114059 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 B6CA23830698 for ; Mon, 9 Jun 2025 16:26:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6CA23830698 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AZQPt+Eh 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.129.124]) by sourceware.org (Postfix) with ESMTP id D4F12383068A for ; Mon, 9 Jun 2025 16:24:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D4F12383068A Authentication-Results: sourceware.org; dmarc=pass (p=quarantine 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 D4F12383068A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749486297; cv=none; b=pSuJK6csxyNEWIu2RopSd0Sd1VORNkU/y6mNWazAlAucmpqBnYPHEplxnnoe1uENzkvlrnNGWCSGjZCHRQxia8vikgwH8CsKXDPY9uUQirLA1PJdwb9ZAZ6WwbKfnbqDHhJNbw6hizcRwUHngMpAea5G+/+2DWtEIR+7ZuiZ2wQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749486297; c=relaxed/simple; bh=m4jYNCOhzzq8xdrGmua/ue90cjpGUTbvW9DRESe6+Ns=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=rl5PmfiXUINYfSY9Fn3OyDSbhZNknOQDChwVbmthxlnBUjXGhidBdqYte4M+Ity25Mv1+0Lv/w6pAK/9BDqgcyRJTx6aAXl4ndb1TEj9cBTwAMicRJ64scSUf/xQaItr67OLlW6mu2BblGnJJG9pLstQiMWhjIEgQ+MImLB1i4U= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4F12383068A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1749486297; 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=p5/JBkG9kUhrbMJK2+zwl51T6d7Qw9k25Ppf5mX51lI=; b=AZQPt+Eh1uRpgzqTg9tzl927VmF2H/TaNYH5PJp7IV13gOJte+IhAlHpcy7IVxLnmnlVs/ 1ScAK7sQj1Orm1PvbVO5RzjGAuKPn6amHfGpRMOZtbGdePzz6YvX6cDqEoSDS4+CckPgz1 OwByL4xjCIxkimDVxa6cU86IkTx2T8Q= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-183-R8sDhNSSMbOj_L3cUwA35Q-1; Mon, 09 Jun 2025 12:24:56 -0400 X-MC-Unique: R8sDhNSSMbOj_L3cUwA35Q-1 X-Mimecast-MFC-AGG-ID: R8sDhNSSMbOj_L3cUwA35Q_1749486295 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BCB1119560B0 for ; Mon, 9 Jun 2025 16:24:55 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.89.91]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BF27119560A3; Mon, 9 Jun 2025 16:24:54 +0000 (UTC) From: Aaron Merey To: elfutils-devel@sourceware.org Cc: Aaron Merey Subject: [PATCH 4/4] doc: Add elf_getarsym.3 Date: Mon, 9 Jun 2025 12:24:39 -0400 Message-ID: <20250609162439.89825-4-amerey@redhat.com> In-Reply-To: <20250609162439.89825-1-amerey@redhat.com> References: <20250609162439.89825-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: MLSD1JUxhP86dbeQpGaSbkp5-6g0JVN-GBMNUeFCAWg_1749486295 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true 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_H5, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, 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 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 Signed-off-by: Aaron Merey --- doc/Makefile.am | 1 + doc/elf_getarsym.3 | 91 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 doc/elf_getarsym.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index aae29ebc..d0ec20da 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -57,6 +57,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ elf_fill.3 \ elf_getarhdr.3 \ elf_getaroff.3 \ + elf_getarsym.3 \ elf_getbase.3 \ elf_getdata.3 \ elf_getscn.3 \ diff --git a/doc/elf_getarsym.3 b/doc/elf_getarsym.3 new file mode 100644 index 00000000..74417b46 --- /dev/null +++ b/doc/elf_getarsym.3 @@ -0,0 +1,91 @@ +.TH ELF_GETARSYM 3 2025-06-06 "Libelf" "Libelf Programmer's Manual" + +.SH NAME +elf_getarsym \- retrieve archive symbol table + +.SH SYNOPSIS +.nf +.B #include + +.BI "Elf_Arsym *elf_getarsym(Elf *" elf ", size_t *" narsyms );" +.fi + +.SH DESCRIPTION +Retrieve the archive symbol table from the archive file associated with +.IR elf . + +.P +If the archive contains a symbol table, +.B elf_getarsym() +returns a pointer to an array of +.B Elf_Arsym +structures describing each symbol and stores the number of symbols in this +array in +.IR narsyms . + +.B Elf_Arsym +has the following layout: + +.P +.nf +typedef struct { + char *as_name; /* Symbol name (null-terminated). */ + int64_t as_off; /* File offset of defining archive member. */ + uint64_t as_hash; /* Hash value of symbol name. */ +} Elf_Arsym; +.fi + + +.SH PARAMETERS +.TP +.I elf +An ELF descriptor referring to an archive file, obtained by calling +.BR elf_begin (3) +on an archive. + +.TP +.I narsyms +A pointer to a +.B size_t +in which the number of entries in the symbol table will be stored. + +.SH RETURN VALUE +If the archive contains a symbol table, +return a pointer to an array of +.B Elf_Arsym +structures and sets +.I *narsyms +to the number of entries in the array. These pointers are managed by +libelf and should not be freed by the caller of +.BR elf_getarsym . + +.P +If the archive does not contain a symbol table or +.I elf +is not a valid archive descriptor, +.B elf_getarsym +returns +.B NULL. + +.SH SEE ALSO +.BR elf_begin (3), +.BR elf_getarhdr (3), +.BR elf_next (3), +.BR libelf (3), +.BR elf (5) + +.SH ATTRIBUTES +.TS +allbox; +lbx lb lb +l l l. +Interface Attribute Value +T{ +.na +.nh +.BR elf_getarsym () +T} Thread safety MT-Safe +.TE + +.SH REPORTING BUGS +Report bugs to or https://sourceware.org/bugzilla/.