From patchwork Mon Feb 12 12:44:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Cambus X-Patchwork-Id: 199730 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2401504dyd; Mon, 12 Feb 2024 04:45:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuaY3se1iNwIN2+15Jn3aGRWwF/VZ5XlC4dUsElkzkcaSOfF+hFSbWIppTW04CJLXrFIm1 X-Received: by 2002:ac8:788:0:b0:42c:65c6:e04d with SMTP id l8-20020ac80788000000b0042c65c6e04dmr7334059qth.14.1707741916547; Mon, 12 Feb 2024 04:45:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707741916; cv=pass; d=google.com; s=arc-20160816; b=tWpZKxMo+IsgAJkTfUG6eDXmYnF7sLUYx8QOHqpty6cDUgdYPID+OaG1200EvRNFrL wsDSPBRAFQCHRnqNhK3ZsfU869LSakRCoqTMkEJqTeX8uX6kwn2LTr9IVcL7u3ae1CD4 9rC/CT+7/9fTtEkCEcudhzEdn92EBF0bCC0QLfz/qiUy99tXc4wJ4FF7FRCnfGZ2oRic 5Sow0SjqfIFZiYtr3a5C2/nTeLeFfWgny7DCFwmdkRN2Cq673cWq/I2SJ9FO5cmaDVDS nddmPgEaONaZ5kyNBTu80qmeLXfyL/VwD10K7h4Y7+jAfihL7KDggI9pnf57mhazZLFe gpPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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:arc-filter:dmarc-filter:delivered-to; bh=ikkUi455ofLYI3rso3I0TA/aJcxbrqt290WKBThs1kQ=; fh=nQjAgsbTJ8wMFR3wRAZqJWWX/qvoBL+++QL6mSfo07Q=; b=JdKlnsTFiBgpptwnwRHbfS3mhgdol0hOjedS/U4vxz068fh1aBJmEpw7hDEWZC5Gsu UmiZ547lsgP5rmZZ4Ab3EIMRvKM6w3frD2jR9y2shNtTVOmrPfLkSGNdtKd9BCUKZ0nO bHvuiwT3zx0GqCdJMQN4qUYoAYIjvrcce4DK/RjUEUHS3NFLITIPDM2nY9STBd6H1T10 jFbP3PTq8bQ1sHX8DkxucgFa101ary//q/VSEDAFO3ql//85AfTUOwHcJVjANhCr4/Lq ji1e+BOBWnflNXe0qmh1EZ8+g93ngDQHlT/aSKqXwLGhXx4KlEwdDGMu7iuLc+wM7dx/ nbFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@statdns.com header.s=fm3 header.b=aserQdd2; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=wSvVkkr+; arc=pass (i=1); 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" X-Forwarded-Encrypted: i=2; AJvYcCVloWW4WzpPqVlVg/BVDINIFdawdX8lNZDH41r/E7Dw7cDCPDoIJ132TYNgvMvS4I92UUYg/JobzC5V5lwxI176pVRleg== Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ay7-20020a05622a228700b0042c7c094b44si295778qtb.655.2024.02.12.04.45.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 04:45:16 -0800 (PST) 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=pass header.i=@statdns.com header.s=fm3 header.b=aserQdd2; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=wSvVkkr+; arc=pass (i=1); 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 1E0EB3858C30 for ; Mon, 12 Feb 2024 12:45:16 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from fout4-smtp.messagingengine.com (fout4-smtp.messagingengine.com [103.168.172.147]) by sourceware.org (Postfix) with ESMTPS id 173283858D32 for ; Mon, 12 Feb 2024 12:45:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 173283858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=statdns.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=statdns.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 173283858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=103.168.172.147 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707741906; cv=none; b=fWcFREWsXcGv/rjnG6Ga0g45lwmdsAWJDA/U9EURseFCUDPKcfjWh+gf9+fHeh3FEqycN0chxSAmo1bl7fcKNbdwNYRx/vJqBumPDcHuTTZJ13kJ2lwKEWUZQsKdlWkwG+8UkLLBFhNaUKq5WyCZpobPYi/E9GlqaJC3UpJkJMU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707741906; c=relaxed/simple; bh=9I0MBgD++Hcf0TR4FNWtWTg0dZJktdsCt4kPK2A95C4=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=FAkH+zFQIPHdCDo8bnQyfyyToxLRXSSdMvahgk2ptkBm4EBxDnlSuSxcxd2wu/YfDSntxWpre4TS/F0Rk5HsaMYX1KuWRmXWPTpG+Abay90tIrvR8sh62yB5EQnbpYDJzbOc7Obzesxx/Wnw28/9fisIwDmfdV3aNCMssVfq4n4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id D6F61138009C for ; Mon, 12 Feb 2024 07:45:04 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 12 Feb 2024 07:45:04 -0500 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:subject:subject:to:to; s=fm3; t=1707741904; x=1707828304; bh=ikkUi455ofLYI3rso3I0TA/aJcxbrqt2 90WKBThs1kQ=; b=aserQdd20ivSG0GqxwbBLr2H9oZWcol8fuIEvsk/lo/Fb6KU I8Us0d7/m/XkS/Km2k9PbzloXQQA6nYqLnCPvQr5FEQMxcwK38MxNEFTPwM6lb4G mABbdc0juaT99Ub1B2QKIGCheQCA78/Bi/awlOvkF+Aarj7+to0Q9Own2R9ug7Qw Q6ux4NKJ/V4DKthlRYy9z69FCCTjh58RV/Okg+gQOBT5whayRItjwpwbDb4TX0iM PGWDoK+I92Fc658gakHw7XVdrfvkZh5vfMxbbo9BKFcLAopbDIy32Qfn7ZxSh7pL NPUSJhgU7MOekV0Om3FT+vCfV6dI83nR6cc//g== 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:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1707741904; x=1707828304; bh=ikkUi455ofLYI3rso3I0TA/aJcxbrqt290W KBThs1kQ=; b=wSvVkkr+LKckO159wQvOOAj/xiygrVRfgYpKuMP3GR3waaOi4D0 S65SyxHxlkNtOSkDktZgxkmjAbT7usQfUReR4DExA7+S9oqgyGgKR9MGSZFPLhO2 X71KwkIA4iODQNDA5fdQ9WxGph1wbVWZKSiEfhY3dbTyI2CAhVtj9/k1jyRK+SMX /PY74DDAJk2HAlkt8THsV2SYZAjxiJQA7FVKVq2w7HK7awYPbJnpOlp30N/OrpWC c+oV++aBeGE0Ny+150NQS42JbfitlkJWKpTIL/xYYXLoidjRCV3mBHpY43ZRyVIo NUwUSnyAwIja1KyIz4kr+5Wz4FntUiRTnng== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefgdegvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggusehttdertddttd dvnecuhfhrohhmpefhrhgvuggvrhhitgcuvegrmhgsuhhsuceofhhrvggusehsthgrthgu nhhsrdgtohhmqeenucggtffrrghtthgvrhhnpefgkeejleeltdehveffjeefhfeiveejle dtffevleekhfetheeludeuueeffeetteenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpehfrhgvugesshhtrghtughnshdrtghomh X-ME-Proxy: Feedback-ID: ic0e9462c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 12 Feb 2024 07:45:03 -0500 (EST) Date: Mon, 12 Feb 2024 13:44:59 +0100 From: Frederic Cambus To: binutils@sourceware.org Subject: [PATCH] Add support to readelf for the PT_OPENBSD_SYSCALLS segment type. Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, SPF_HELO_NONE, SPF_PASS, 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: binutils@sourceware.org X-Mailman-Version: 2.1.30 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790697187965149193 X-GMAIL-MSGID: 1790697187965149193 binutils * readelf.c (get_segment_type): Handle PT_OPENBSD_SYSCALLS segment type. include * elf/common.h (PT_OPENBSD_SYSCALLS): Define. --- binutils/ChangeLog | 5 +++++ binutils/readelf.c | 1 + include/ChangeLog | 4 ++++ include/elf/common.h | 1 + 4 files changed, 11 insertions(+) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 438a45d77a8..b74847adcee 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2024-02-12 Frederic Cambus + + * readelf.c (get_segment_type): Handle PT_OPENBSD_SYSCALLS segment + type. + 2024-01-26 Nick Clifton PR 31250 diff --git a/binutils/readelf.c b/binutils/readelf.c index e3bf68064c1..6e3ac1baf6d 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -5105,6 +5105,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_NOBTCFI: return "OPENBSD_NOBTCFI"; + case PT_OPENBSD_SYSCALLS: return "OPENBSD_SYSCALLS"; case PT_OPENBSD_BOOTDATA: return "OPENBSD_BOOTDATA"; default: diff --git a/include/ChangeLog b/include/ChangeLog index 4b667bfa307..11c4b321a49 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2024-02-12 Frederic Cambus + + * elf/common.h (PT_OPENBSD_SYSCALLS): Define. + 2024-01-29 Jose E. Marchesi * opcode/bpf.h (enum bpf_insn_id): Remove BPF_INSN_LDINDDW and diff --git a/include/elf/common.h b/include/elf/common.h index 6a66456cd22..832f9bd510f 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -496,6 +496,7 @@ #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_NOBTCFI (PT_LOOS + 0x5a3dbe8) /* No branch target CFI. */ +#define PT_OPENBSD_SYSCALLS (PT_LOOS + 0x5a3dbe9) /* System call sites. */ #define PT_OPENBSD_BOOTDATA (PT_LOOS + 0x5a41be6) /* Section for boot arguments. */ /* Mbind segments */