From patchwork Fri Oct 2 21:59:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 303786 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8F5EC35257 for ; Fri, 2 Oct 2020 22:03:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B03C20719 for ; Fri, 2 Oct 2020 22:03:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="c3RN+aji" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B03C20719 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:32826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kOT9W-0006Mm-0S for qemu-devel@archiver.kernel.org; Fri, 02 Oct 2020 18:03:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kOT5x-0002ZD-Uw for qemu-devel@nongnu.org; Fri, 02 Oct 2020 18:00:05 -0400 Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:41956) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kOT5v-0007NH-OT for qemu-devel@nongnu.org; Fri, 02 Oct 2020 18:00:05 -0400 Received: by mail-ot1-x342.google.com with SMTP id q21so2871347ota.8 for ; Fri, 02 Oct 2020 15:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8JkogZW08o4QbERarC4qat0jsqD9fmDjl7gKGBrUP6I=; b=c3RN+aji6elqAzxQuRf0rQc9a0thf5PgQZjIrZc/eCTeEInfcnBayDCUPLQdNLtcR1 6GS+qYB4TQU2KQ5QtrmvAGS/witbEbPSItSYWJwL9W5g9NYEbG3PrhB/80XN9msaE8UI LHvkKV3KoWXYHgrzoateQGCnURj4VBRz1izfuNx6AKYcZOGI2ta8749jvX9mFgvv3rhM 7vfZipBVPVe7MZHEPvQgPofnUuVdCnnwdZAmp8XAH9FAig0lVO9VDz6Qn6yy44mBdLQ6 TVLNluaFsaDjmbFNatPCApTYCmcf9/kLvjQi1/jQ3T+FQqsGa8wNcfLgZgMwIDtmOAJf Oe9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8JkogZW08o4QbERarC4qat0jsqD9fmDjl7gKGBrUP6I=; b=tQksylTTfUGzpsaQ7Qhzs+4I5baquN3e41n6dP6sspP7n9SOfhbFspVEgQ1ruxE/Yg Y7u3xTVv5jUf4YsmN9xI/ddxTZkN3xkAEmwpr1IQjCb8FLRw0mM2lsFieyeZ760ANNyx GAfzV3WZTcBNpjwXJ7jvrOS6SMIzbWAMtLejSfkrNgQZGPUEg9oxcszjfSPso1t9iCTb /UwZQvFuR4VOYY6ifE/CsceoDXa0NLToT3FF/Rt2IG0rTM+CuXwOPgmcz/iFqXfnTU+H HXWtvg0iysjnndkhsnr2X8jHTmwDe0KMKzqhRYEl/8q6rlGzon4SGevbAhJgANQXDJOV EYMA== X-Gm-Message-State: AOAM533xXU2qxhYVPa2jbrIdNV2xOfy0oyaoHjOxMS0hESXhf1AHsyLH FRFDJHbu46xqF7z2+Hus/IcT9kS54vvt7FUy X-Google-Smtp-Source: ABdhPJwP9J3brY/GoD1M9WbIcvO7jrfA7Gsjh4ejWLvR0DZsLiV8lIDKBxcu9oEVC8I/GFI0WBQaqg== X-Received: by 2002:a9d:1442:: with SMTP id h60mr3387353oth.35.1601676002120; Fri, 02 Oct 2020 15:00:02 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id k10sm684268ots.60.2020.10.02.15.00.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 15:00:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v10 3/8] include/elf: Add defines related to GNU property notes for AArch64 Date: Fri, 2 Oct 2020 16:59:50 -0500 Message-Id: <20201002215955.254866-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201002215955.254866-1-richard.henderson@linaro.org> References: <20201002215955.254866-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::342; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" These are all of the defines required to parse GNU_PROPERTY_AARCH64_FEATURE_1_AND, copied from binutils. Other missing defines related to other GNU program headers and notes are elided for now. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- include/elf.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/elf.h b/include/elf.h index c117a4d1ab..10126ff809 100644 --- a/include/elf.h +++ b/include/elf.h @@ -26,9 +26,13 @@ typedef int64_t Elf64_Sxword; #define PT_NOTE 4 #define PT_SHLIB 5 #define PT_PHDR 6 +#define PT_LOOS 0x60000000 +#define PT_HIOS 0x6fffffff #define PT_LOPROC 0x70000000 #define PT_HIPROC 0x7fffffff +#define PT_GNU_PROPERTY (PT_LOOS + 0x474e553) + #define PT_MIPS_REGINFO 0x70000000 #define PT_MIPS_RTPROC 0x70000001 #define PT_MIPS_OPTIONS 0x70000002 @@ -1657,6 +1661,24 @@ typedef struct elf64_shdr { #define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */ #define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension regs */ +/* Defined note types for GNU systems. */ + +#define NT_GNU_PROPERTY_TYPE_0 5 /* Program property */ + +/* Values used in GNU .note.gnu.property notes (NT_GNU_PROPERTY_TYPE_0). */ + +#define GNU_PROPERTY_STACK_SIZE 1 +#define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2 + +#define GNU_PROPERTY_LOPROC 0xc0000000 +#define GNU_PROPERTY_HIPROC 0xdfffffff +#define GNU_PROPERTY_LOUSER 0xe0000000 +#define GNU_PROPERTY_HIUSER 0xffffffff + +#define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000 +#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1u << 0) +#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1u << 1) + /* * Physical entry point into the kernel. *