From patchwork Tue May 19 20:37:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 1293758 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=a+SDkgST; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49RSQP2Ytfz9sT3 for ; Wed, 20 May 2020 06:38:37 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 954593954C07; Tue, 19 May 2020 20:38:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 954593954C07 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589920707; bh=1eS04HQIrseje/Q4T6o8uHgDrYxqZKme96HxdkpBXa4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=a+SDkgSTQjAp207i8F3NVvZiFnSzPmLI5CgDy1R/BwmdZPHtE9OoQVpL+ca/382ZF Nzdw99c+V78ZmYruZvLtA8nmfZBMwfNQaqym0fl60SIrxoX06sySc0bDCuTGNWDs9t g4TnUb3fIM8YuyolhduwjQ3PXrlLqP+oxj+Fntns= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by sourceware.org (Postfix) with ESMTPS id 87CE43894E6A for ; Tue, 19 May 2020 20:38:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 87CE43894E6A Received: by mail-pf1-x443.google.com with SMTP id y18so438567pfl.9 for ; Tue, 19 May 2020 13:38:25 -0700 (PDT) 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=1eS04HQIrseje/Q4T6o8uHgDrYxqZKme96HxdkpBXa4=; b=j7c4JTws8Nt8JREMFyJdYux5NP6obnEGWU8U50vXkibsJNSAkRfgUJGx9L0nZCCGJB 5d9PM4cqvo0F9drilKJXvD95HuFDUrMpgd3LfboyHea2cLcOx92jiuQaT+SB47J3bkFk S29dkWWlxZtpoZ14NcBkABt5nESyU+7f0urhV5kT8SpVmMO3tKqAtudIyWiHIIRw5NXl QeXydZFXniBi0fTbLliuZhUP4O7+7pKcKcE10Urx/SyTUCMtUUePVUyDoembmu8QKxcS 2T5XcgH1YIluf7z1OhPbWCM0qD9MTlcBd59zn6ZxVOlSB/4nMXUStBVinpSfQ9PlO8gR WK7g== X-Gm-Message-State: AOAM531+3gf/mxHP9qeQkxPsj3i/i7Ys603d7ydwRKuGt780zoBgYXK1 bU4PFHgQYXYT2jnSXDd/Oy+XuuNC X-Google-Smtp-Source: ABdhPJzXtVcvvi+QZNY4+c4tQolyJJbB0rLBt8tUwady0uW+SQtRQn/w8eS3GGpklG+i/hbA4yFEoQ== X-Received: by 2002:a63:f958:: with SMTP id q24mr931203pgk.338.1589920704353; Tue, 19 May 2020 13:38:24 -0700 (PDT) Received: from localhost (g216.222-224-245.ppp.wakwak.ne.jp. [222.224.245.216]) by smtp.gmail.com with ESMTPSA id h17sm313111pfr.25.2020.05.19.13.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 13:38:23 -0700 (PDT) To: GCC patches Subject: [PATCH 5/5] or1k: Fixup exception header data encodings Date: Wed, 20 May 2020 05:37:50 +0900 Message-Id: <20200519203750.401593-6-shorne@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200519203750.401593-1-shorne@gmail.com> References: <20200519203750.401593-1-shorne@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Stafford Horne via Gcc-patches From: Stafford Horne Reply-To: Stafford Horne Cc: Openrisc Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" While running glibc tests several *-textrel tests failed showing that relocations remained against read only sections. It turned out this was related to exception headers data encoding being wrong. By default pointer encoding will always use the DW_EH_PE_absptr format. This patch uses format DW_EH_PE_pcrel and DW_EH_PE_sdata4. Optionally DW_EH_PE_indirect is included for global symbols. This eliminates the relocations. gcc/ChangeLog: * config/or1k/or1k.h (ASM_PREFERRED_EH_DATA_FORMAT): New macro. --- gcc/config/or1k/or1k.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/config/or1k/or1k.h b/gcc/config/or1k/or1k.h index 0d6fed5f4ca..2fe62f0b90c 100644 --- a/gcc/config/or1k/or1k.h +++ b/gcc/config/or1k/or1k.h @@ -408,4 +408,8 @@ do { \ ((N) < 4 ? HW_TO_GCC_REGNO (25) + (N) : INVALID_REGNUM) #define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, EH_RETURN_REGNUM) +/* Select a format to encode pointers in exception handling data. */ +#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ + (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) + #endif /* GCC_OR1K_H */