From patchwork Fri Mar 17 07:50:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Cambus X-Patchwork-Id: 71117 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp202396wrt; Fri, 17 Mar 2023 00:51:00 -0700 (PDT) X-Google-Smtp-Source: AK7set8VdBV+utJQnY61OvaFDjM+jjMq2Z9rhUKi55x21AbJjTt3y5Rd73SLK+lbsXXdxJ6AEvhs X-Received: by 2002:a17:906:1355:b0:930:e53e:759b with SMTP id x21-20020a170906135500b00930e53e759bmr3487824ejb.11.1679039460012; Fri, 17 Mar 2023 00:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679039459; cv=none; d=google.com; s=arc-20160816; b=YMZqJ68OmL2r+qQCQMdeob+ZvrUMqubDj8fgip6dEMIRJDscX7Vs9PW2NbcgkWE6Qz XaybH7NSFvmJ34/dcGvMEGqfOgYThjz0lLEyHvDiGvgqCy4bQs3vuyl+uGXxNK0OOqAA UXLmPrBE7kATKEtYw81NjlHzUHZacQeZRSZux14AnAOMB3q7KhK8pFdEmZWMiEYSLNZp 60UdrFlEK8uAUvaXxvbPw/S9T+y3JZrMUwrMJnaSCN2rfWtlD65Gm1L+Gh8seh+kFH/V /dWT0+A55fh/hRGNEgLv2UnhNqcL1n5mHoB9+P+QsHoP+l8/3eeMLHjitSHVlfVMFVI3 IY9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:to:from:date:feedback-id :dkim-signature:dkim-signature:dmarc-filter:delivered-to; bh=ghxCuJGNUE8N53K3GmwJXkeypWadBVdbhab3msVb3OY=; b=AQPnBN0f5Uw2dRhb9WWqZFxPSL/78faLYjtelrQSZpFnlK6YdhxgFj2rlg3xagLSun LRx6jBydgUa4qpdY/Na8b49Vv9VdjZxqLzu5yRifPxJvashLpiDGgI64+c/6h9pWUqy1 DDkVqWUykakWncNF6de7pLBmguYnX7QmFzz2R9WNy7svhrpghZrVHCGhdA7uDxQCm0H4 /q9K/gADST1XlIkUqPEg0ZyAPLr9/tc506TkQdkAoRYZvqtAefsVod8qiXYO9K/sN24f PeJIFAm275QKj/GSwMTzn6EXlYQKvktIYFx0gAFZFFXZlYNnu+oHXCKRa3A/6lube7V/ Qu7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@statdns.com header.s=fm1 header.b=O+0pMTN8; dkim=fail header.i=@messagingengine.com header.s=fm2 header.b=lW2aouO7; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id hc20-20020a170907169400b00931ca549164si1845626ejc.614.2023.03.17.00.50.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Mar 2023 00:50:59 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=fail header.i=@statdns.com header.s=fm1 header.b=O+0pMTN8; dkim=fail header.i=@messagingengine.com header.s=fm2 header.b=lW2aouO7; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 293F73851AB8 for ; Fri, 17 Mar 2023 07:50:58 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by sourceware.org (Postfix) with ESMTPS id 6ED813858423 for ; Fri, 17 Mar 2023 07:50:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6ED813858423 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=statdns.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=statdns.com Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 8967B320089C for ; Fri, 17 Mar 2023 03:50:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 17 Mar 2023 03:50:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=statdns.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t=1679039446; x=1679125846; bh=ghxCuJGNUE8N53K3GmwJXkeyp WadBVdbhab3msVb3OY=; b=O+0pMTN8gjMigi8PpJW2/6O2nx+huOExOot9kzNns 6CjJYEgdQ1RTxRpiHCBuxX589u6jWHmoybcUI1USCo1lfaAT7LLXhcMqaMUc5DwR 28RlSr2QzffmpqhbbQ5EDujX1oIAXS3tN1k2GgPtOn4owU1ehDCjb+5GCoyxoQZj ArvzMR7/D8LBPUj9pwGrUzdAwb2I9ecjJIhDD/ZlaT1G+g7BTz/VtawCsZjTMGLO 30GB9jb558Wa0/IRjTc/vvramYIzX8NsvSgZp3aPR4Ncg6Zy2ajEPZf/dS64m1yL C3XZNXNxmsGU6avSB4YJo8f1cicFa+hF5n1tlgraAiIrg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1679039446; x=1679125846; bh=ghxCuJGNUE8N53K3GmwJXkeypWadBVdbhab 3msVb3OY=; b=lW2aouO7T6UeKt9F3KQREemzyxz+JyOSHrBOB6jTEUZqvkoUCJ8 tkiajh+dU9We4fYBaN0hF2lc6UUNXjvQ1L7IDs3fRR2I4B0NfAqF67wBARRsXThD TttqQZBrel5VRubQKjZi37/jnqAHntxHfRs0Mbfi5QyQwtViTO8mwsDuIm9PVtj3 EXU0XuHfs+XxNiehbygkklXwQqmGgr0RLzE08DM0f560CxIT+C6euyUxUqr/TafR wZqzU2Y4YUvLml3id6dxQlt2Zi9VY23Mv7aXj3uUMDmbn3i5FaGhWXk4cyL2KyGE D/IR3PF7qP1eIT3L/7e9TftKrd8gjceXf/A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdefuddguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggusehttdertd dttddvnecuhfhrohhmpefhrhgvuggvrhhitgcuvegrmhgsuhhsuceofhhrvggusehsthgr thgunhhsrdgtohhmqeenucggtffrrghtthgvrhhnpefgkeejleeltdehveffjeefhfeive ejledtffevleekhfetheeludeuueeffeetteenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehfrhgvugesshhtrghtughnshdrtghomh X-ME-Proxy: Feedback-ID: ic0e9462c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 17 Mar 2023 03:50:45 -0400 (EDT) Date: Fri, 17 Mar 2023 08:50:42 +0100 From: Frederic Cambus To: binutils@sourceware.org Subject: [PATCH] Add support to readelf for the PT_OPENBSD_MUTABLE segment type. Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760600480964689632?= X-GMAIL-MSGID: =?utf-8?q?1760600480964689632?= binutils/ChangeLog: 2023-03-17 Frederic Cambus * readelf.c (get_segment_type): Handle PT_OPENBSD_MUTABLE segment type. include/ChangeLog: 2023-03-17 Frederic Cambus * elf/common.h (PT_OPENBSD_MUTABLE): Define. --- binutils/readelf.c | 1 + include/elf/common.h | 1 + 2 files changed, 2 insertions(+) diff --git a/binutils/readelf.c b/binutils/readelf.c index 0d9d2017901..33df75561c1 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -4643,6 +4643,7 @@ get_segment_type (Filedata * filedata, unsigned long p_type) case PT_OPENBSD_RANDOMIZE: return "OPENBSD_RANDOMIZE"; case PT_OPENBSD_WXNEEDED: return "OPENBSD_WXNEEDED"; case PT_OPENBSD_BOOTDATA: return "OPENBSD_BOOTDATA"; + case PT_OPENBSD_MUTABLE: return "OPENBSD_MUTABLE"; default: if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC)) diff --git a/include/elf/common.h b/include/elf/common.h index d19d6f9927d..e99f2bb864e 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -492,6 +492,7 @@ #define PT_GNU_SFRAME (PT_LOOS + 0x474e554) /* SFrame stack trace information */ /* OpenBSD segment types. */ +#define PT_OPENBSD_MUTABLE (PT_LOOS + 0x5a3dbe5) /* Like bss, but not immutable. */ #define PT_OPENBSD_RANDOMIZE (PT_LOOS + 0x5a3dbe6) /* Fill with random data. */ #define PT_OPENBSD_WXNEEDED (PT_LOOS + 0x5a3dbe7) /* Program does W^X violations. */ #define PT_OPENBSD_BOOTDATA (PT_LOOS + 0x5a41be6) /* Section for boot arguments. */