From patchwork Tue Jul 1 03:12:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Merey X-Patchwork-Id: 115357 X-Patchwork-Delegate: mark@klomp.org 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 9E9A8385C40E for ; Tue, 1 Jul 2025 03:18:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E9A8385C40E 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=RF2YBFQp 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 DA16C385C40E for ; Tue, 1 Jul 2025 03:13:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DA16C385C40E 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 DA16C385C40E 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=1751339598; cv=none; b=o6MDXTWd2drBGDjs11MmCX2ccdG/S8VSTu4/aSuDvMiZPVCBnY5xpUm1ZLCUksNQJgU578HBd/tzqCgKdmmRXEMwNJ6uOtqc62Z4fxbaNHM9x2IhT1xViq4DjGlkaRH54OxGN3Wdvs/wAtEPgLpknJyaYhJtxq2icGuSPW4cFQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1751339598; c=relaxed/simple; bh=TtWTAAgerbjuGQBuQRdL31ZXZd6qH4fgdJU5ogVDO40=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=TsilNVp1CBi3SPPWTq2C0qD3aj2Yu9N0DA3PLEKzOphiOUoyzxhieN1lEGULLBPommdoqbi9fPTao7yKPp36OvFsuWfOJMTkaLcELlKO+SohmLS+vJ21HNKt5vJf5YPcwKJk9XQ8gly/UTt3NcJ4OtfowL/V9PgAzBrbpDcDKX8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA16C385C40E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1751339598; 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=rUuKhA5nUO8PcezYUUIxCJVscp32iGBryPfbByK56h4=; b=RF2YBFQpG2/9xhLJcLi/7BuWbA0GwIgN3WD/5buwj1sbRQ9BdSgtOVosTLd9CqhHQ0gcHS RF2v7trIYACKpGl7fp+1L6UH77D4Zjsi9tBe+h4RsBgfbtkpLlFjf5BGCWbCVFFypE/cyu iiJN0d7VDUKBZF3V67aakgrYz39p2SU= Received: from mx-prod-mc-05.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-380-TXs3Q1hrNkS1rqQjfmZViw-1; Mon, 30 Jun 2025 23:13:17 -0400 X-MC-Unique: TXs3Q1hrNkS1rqQjfmZViw-1 X-Mimecast-MFC-AGG-ID: TXs3Q1hrNkS1rqQjfmZViw_1751339596 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 187CE1944AA6 for ; Tue, 1 Jul 2025 03:13:16 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.80.66]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6E72330001B1; Tue, 1 Jul 2025 03:13:15 +0000 (UTC) From: Aaron Merey To: elfutils-devel@sourceware.org Cc: Aaron Merey Subject: [PATCH 09/16] doc: Add elf_newdata.3 Date: Mon, 30 Jun 2025 23:12:26 -0400 Message-ID: <20250701031248.1106390-9-amerey@redhat.com> In-Reply-To: <20250701031248.1106390-1-amerey@redhat.com> References: <20250701031248.1106390-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: PUHc_cl9IIeMGcjwOsUHXomvLK6JGmed7rhHi9tDV3M_1751339596 X-Mimecast-Originator: redhat.com content-type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-13.0 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_HOSTKARMA_W, 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_newdata.3 | 75 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 doc/elf_newdata.3 diff --git a/doc/Makefile.am b/doc/Makefile.am index 98712576..97aac570 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -79,6 +79,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ elf_kind.3 \ elf_memory.3 \ elf_ndxscn.3 \ + elf_newdata.3 \ elf_update.3 \ elf_version.3 \ libelf.3 diff --git a/doc/elf_newdata.3 b/doc/elf_newdata.3 new file mode 100644 index 00000000..4a8a77ad --- /dev/null +++ b/doc/elf_newdata.3 @@ -0,0 +1,75 @@ +.TH ELF_NEWDATA 3 2025-06-30 "Libelf" "Libelf Programmer's Manual" + +.SH NAME +elf_newdata \- create a new Elf_Data descriptor for a section + +.SH SYNOPSIS +.nf +#include + +.BI "Elf_Data * elf_newdata(Elf_Scn *" scn ");" +.fi + +.SH DESCRIPTION +The +.BR elf_newdata () +function creates a new +.BR Elf_Data +descriptor associated with the section referred to by +.I scn . +This descriptor can be used to describe new section contents for an ELF object +being constructed or modified. + +The section must not be the null section (index 0), and the section header must +already be initialized (for example, by calling +.BR elf_getshdr () +after creating the section via +.BR elf_newscn ()). +If the section has not yet been assigned data, or was created using +.BR elf_newscn (), +this function creates the first +.BR Elf_Data +descriptor for the section. + +Subsequent calls to +.BR elf_newdata () +will append new data descriptors to the section. + +The returned descriptor is marked dirty so that it will be included during +.BR elf_update () . + +.SH PARAMETERS +.TP +.I scn +A section descriptor to which the new data descriptor should be attached. +Must not be the null section. + +.SH RETURN VALUE +On success, a pointer to a new, writable +.BR Elf_Data +descriptor is returned. On failure, NULL is returned. + +The caller is responsible for configuring the return value. + +.SH SEE ALSO +.BR elf_getdata (3), +.BR elf_newscn (3), +.BR elf_update (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_newdata () +T} Thread safety MT-Safe +.TE + +.SH REPORTING BUGS +Report bugs to or https://sourceware.org/bugzilla/.