| Message ID | 20250715042557.708628-1-amerey@redhat.com |
|---|---|
| State | Committed |
| Delegated to: | Mark Wielaard |
| Headers |
Return-Path: <elfutils-devel-bounces~patchwork=sourceware.org@sourceware.org> 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 C6E143858433 for <patchwork@sourceware.org>; Tue, 15 Jul 2025 04:27:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6E143858433 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=iJImyOGE 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 A90433858D37 for <elfutils-devel@sourceware.org>; Tue, 15 Jul 2025 04:26:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A90433858D37 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 A90433858D37 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=1752553568; cv=none; b=C7z8C11LWtWXSf461WdgzDfRzFeC9npFYdxOpXsQmXckxWVDL6WPPKqhXETOE2zUOYYctLuC7SJrxPW8sDFIjBMTbGfY3EZwSIdDIcg3ISr3ptMwE+yYZ0CJir1gQ/1QIQErwAFoaE0mK2SHne8JGsBXDveRdGPFmlgJb5YIdFo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752553568; c=relaxed/simple; bh=VmPoXBD0n7WD13eyoEuA9FSGTUMFhv7JdvmqCH1rUbc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UL8od+q8HCGK0adFyyQHXkAJA+KF6MZDZNVg9y5vfHdmDzZpkwV3DZRRZrT6C3Sv9u8eDmuC4t/0ZmLS1R5Dwq96iEu4+3ZyVTi8t8j2i4L2QVeYGfN1ZBqb1x2Szx/G0sQaJ5K9oLSbmJPjWd458r64HrEY1RoBonxcZlUPJpY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A90433858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752553568; 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=JZuctE07dIGG+wzd6J88j+PmjhUqM7oQN+m57GiX7k8=; b=iJImyOGELEh5vhthaY2UQDJn4/udNhgdJkJ0LpcK8iHFJNWfU+289YSvL9r0qCZLZCqOiU MSNlthm3l5GO7K/njxdHLpvrpdZLhJc7LDpGT8hopPHfCN2UDMA/s+Q3VoN/ALS0l/XMiP pEZ1lPyDue9cJhi3hv5dKUx0Id286r4= Received: from mx-prod-mc-03.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-218-ntd7z0OPOumB3BxkV-5HZQ-1; Tue, 15 Jul 2025 00:26:06 -0400 X-MC-Unique: ntd7z0OPOumB3BxkV-5HZQ-1 X-Mimecast-MFC-AGG-ID: ntd7z0OPOumB3BxkV-5HZQ_1752553565 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D332719560B0 for <elfutils-devel@sourceware.org>; Tue, 15 Jul 2025 04:26:05 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.64.35]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EF5641955F21; Tue, 15 Jul 2025 04:26:04 +0000 (UTC) From: Aaron Merey <amerey@redhat.com> To: elfutils-devel@sourceware.org Cc: Aaron Merey <amerey@redhat.com> Subject: [PATCH 1/7] elf_getaroff: Fix elf_getaroff error return value Date: Tue, 15 Jul 2025 00:25:51 -0400 Message-ID: <20250715042557.708628-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: c4YJPzIKV6mJGQtGZXWBskBnwcljftiQqXWh6trqeIo_1752553565 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit 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 <elfutils-devel.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/elfutils-devel>, <mailto:elfutils-devel-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/elfutils-devel/> List-Post: <mailto:elfutils-devel@sourceware.org> List-Help: <mailto:elfutils-devel-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/elfutils-devel>, <mailto:elfutils-devel-request@sourceware.org?subject=subscribe> Errors-To: elfutils-devel-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
[1/7] elf_getaroff: Fix elf_getaroff error return value
|
|
Commit Message
Aaron Merey
July 15, 2025, 4:25 a.m. UTC
elf_getaroff currently returns ELF_C_NULL (0) to indicate that an error
occured (ex. the Elf descriptor is not associated with an archive).
However elf_getaroff is intended to return -1 if an error occurs.
eu-ar assumes -1 indicates an error and other libelf implementations
use -1 to indicate an error in elf_getaroff.
Replace ELF_C_NULL with -1 as elf_getaroff's error return value.
Signed-off-by: Aaron Merey <amerey@redhat.com>
---
libelf/elf_getaroff.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Aaron, On Tue, 2025-07-15 at 00:25 -0400, Aaron Merey wrote: > elf_getaroff currently returns ELF_C_NULL (0) to indicate that an error > occured (ex. the Elf descriptor is not associated with an archive). > > However elf_getaroff is intended to return -1 if an error occurs. > eu-ar assumes -1 indicates an error and other libelf implementations > use -1 to indicate an error in elf_getaroff. > > Replace ELF_C_NULL with -1 as elf_getaroff's error return value. I agree this makes sense given elf_getaroff returns an offset. Thanks, Mark
diff --git a/libelf/elf_getaroff.c b/libelf/elf_getaroff.c index 5c102ad6..5737b350 100644 --- a/libelf/elf_getaroff.c +++ b/libelf/elf_getaroff.c @@ -43,7 +43,7 @@ elf_getaroff (Elf *elf) { /* Be gratious, the specs demand it. */ if (elf == NULL || elf->parent == NULL) - return ELF_C_NULL; + return -1; /* We can be sure the parent is an archive. */ Elf *parent = elf->parent;