From patchwork Fri Jan 14 03:41:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 50006 Return-Path: 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 5C6CC385842F for ; Fri, 14 Jan 2022 03:42:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 8D3D93858D37 for ; Fri, 14 Jan 2022 03:42:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8D3D93858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pg1-x52a.google.com with SMTP id t32so1685012pgm.7 for ; Thu, 13 Jan 2022 19:42:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=subject:date:message-id:mime-version:content-transfer-encoding:cc :from:to; bh=oNQ2/H+mNnfOu/mtNXEzUfKPyG8tajdbmw4ifcQvfos=; b=PPLvgpQ83k9SHKKZd+MMDrApj1HhxR+Ht2XRbfcrTaO05hbqRdukjEZE7zQ5YqLWDf fbHoZtQ4a7tQqWxEdy4241ex3+s8eFGObSeCRyB4XmP88RG6x3e+nneVHIukr6mQEJNs 6PDsluvBjeuPxJQ7b5OZsf/jY7xD0F7Gb0/5nTG3siu9nezQli0p2Z6Exp9P6bzVLnw4 znJZ/1QIrPnq2dVL9v/3g524xFxd4/pIeqwcYLQP8KatGlgrWF5XHwd/PwBwJLHxYeE2 fVLcEukU2J0oN9ATWEIojJfn/ozZWcs/t0WuSfbMG7j+SWuW3pVCz6OXaDh/WwlNstGC enKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:date:message-id:mime-version :content-transfer-encoding:cc:from:to; bh=oNQ2/H+mNnfOu/mtNXEzUfKPyG8tajdbmw4ifcQvfos=; b=MussqU8lOh74vKrNhkwRKf+iMGoKkNgpjZsh7kkte6t3S2maggjqzknymTKr5e1xae xxHnzbhK9q4eWHeXFfQGczpNP35Jhax8uQm0NQVhFdzaJsmmOkOCVTquPM1yRevALPcE /wNREauIMHL1Ag3sf7reiMk774OotYFvGZ/4ZGXoYJVQue5OtPaFdhpVtY67UxBAmVFz zYxSHl3tX+q35YJuZr7AfLi7gxg+hYQDwZLeFyaYwKWQLmUuv13vv1ZbESbBKcIwV6cu 5t1iwgs4jMyuVyfHXgtepGN5CtgDCbu/Or46ssPfLmHgoro7Y7l5SW0VGagRJeDTC7l+ xz2A== X-Gm-Message-State: AOAM530k3zMEzQTqv8xm/BDlZ1pQ4Q+CugCMLc92vBwmq28X7NBeSEnF 0ybDY8/hOpv8JV3gJ2UlFH21Ig== X-Google-Smtp-Source: ABdhPJwaEDKAL1qwhDGXUVxoFdI4P4umFM+LxBqsTTOiE7DHx2OfL4y/633+u9chRgMxKQtbV/ghEA== X-Received: by 2002:a63:7110:: with SMTP id m16mr6369665pgc.621.1642131735596; Thu, 13 Jan 2022 19:42:15 -0800 (PST) Received: from localhost ([12.3.194.138]) by smtp.gmail.com with ESMTPSA id 10sm4083507pfm.56.2022.01.13.19.42.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jan 2022 19:42:14 -0800 (PST) Subject: [PATCH] RISC-V: Document the degree of position independence that medany affords Date: Thu, 13 Jan 2022 19:41:26 -0800 Message-Id: <20220114034126.25733-1-palmer@rivosinc.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 From: Palmer Dabbelt To: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The code generated by -mcmodel=medany is defined to be position-independent, but is not guarnteed to function correctly when linked into position-independent executables or libraries. See the recent discussion at the psABI specification [1] for more details. [1]: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/245 gcc/ChangeLog: * doc/invoke.texi: Document the degree of position independence that -mcmodel=medany affords. Signed-off-by: Palmer Dabbelt --- gcc/doc/invoke.texi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 5504971ea81..eaba12bb61f 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -27568,6 +27568,10 @@ Generate code for the medium-any code model. The program and its statically defined symbols must be within any single 2 GiB address range. Programs can be statically or dynamically linked. +The code generated by the medium-any code model is position-independent, but is +not guarnteed to function correctly when linked into position-independent +executables or libraries. + @item -mexplicit-relocs @itemx -mno-exlicit-relocs Use or do not use assembler relocation operators when dealing with symbolic