From patchwork Fri Nov 5 21:05:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 47135 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 2B0CB3858035 for ; Fri, 5 Nov 2021 21:06:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2B0CB3858035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636146368; bh=kzGvW6E8vl2t28f1GpLC3ONPZDhnxRTtoWVU+bboSx4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=xDLFkmV4BbWJU3uVaBGN1jLM/KnEJX33bb6mMspy4GG5AVWHA1ODhmQl/37oec+le t/hNJ4L6tffu4+b66TuVtk/s6fL36V72R10j3PhvoWq5YKdOqlzzsgg+xauSimPLzf jlF58Ys3DBBSCzFzOmHon3TvIoPkcwGLWSEXT11I= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id DE04E385840A for ; Fri, 5 Nov 2021 21:05:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DE04E385840A Received: by mail-wr1-x42d.google.com with SMTP id r8so15659669wra.7 for ; Fri, 05 Nov 2021 14:05:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:reply-to :mime-version:content-transfer-encoding; bh=kzGvW6E8vl2t28f1GpLC3ONPZDhnxRTtoWVU+bboSx4=; b=PIdAshPpo2XL6AHkyvObr/HR+LODflGipt3gOIRmQdteB6hvAK1WgbKba8qhTCaXRN dkthnS4kwgnfOzOLSNmH6hshoh6XC0zW/2PcO/hujnAwtaiqA8eiGR0SSyKerAN5Nmb5 CS3HLpOjUbToyIZ/qhWDVdfClq+M9WoD73IV3scSK/k9RgtHREtM5NyN1yWTe/vJpqes psvrE5Q7OvxQy5V49oWfDqv68zdgK8UdXub6g0gjONntNSQtiRdOGRkctpMGvShVshew dSVa6ic87rA3il8fsLzbyXDeIMeX2wictwdxLkNX78IDJEbJqoPCM0SI5qDb/SA1dv2I ybhQ== X-Gm-Message-State: AOAM533e6huhkm5IEfdysBiwYJO7dT7cmI7vsCwr8tU6Ci1UafSe3qcf oRUHecfiVcDGZS2FLeLRxByUFfleYOo= X-Google-Smtp-Source: ABdhPJyHiKXLfknoQhvT2AuS5wMBx/f/wlei3B19jQoPPU+saey1tgW6LutDThcQiouQG533aJNeaA== X-Received: by 2002:adf:fd4c:: with SMTP id h12mr63579659wrs.429.1636146335929; Fri, 05 Nov 2021 14:05:35 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id h22sm9966963wmq.14.2021.11.05.14.05.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Nov 2021 14:05:35 -0700 (PDT) X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] Darwin : Make trampoline templates linker-visible. Date: Fri, 5 Nov 2021 21:05:29 +0000 Message-Id: <20211105210529.8817-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 X-Spam-Status: No, score=-8.5 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.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: , X-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" For aarch64, the alignment of the LTRAMPn symbols matters. Actually, the LTRAMPn symbols _are_ 8 byte aligned, but because they are Local, the linker doesn't know that this guarantee can be met. It assumes that they are not necessarily more aligned than the containing section (ld64 atoms strike again). The fix is to publish the trampoline symbol for the linker to access directly - it can then see that the atom is suitably aligned. Fixes issue #11 on the development branch. Tested on x86_64-darwin, aarch64-darwin and x86_64-linux, pushed to master, thanks Iain Signed-off-by: Iain Sandoe gcc/ChangeLog: * config/darwin.h (ASM_GENERATE_INTERNAL_LABEL): Add LTRAMP to the list of symbol prefixes that must be made linker- visible. --- gcc/config/darwin.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 27cb3e4bb30..e54cbb11cee 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -921,6 +921,8 @@ extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS]; sprintf (LABEL, "*%s%ld", "lubsan_type", (long)(NUM));\ else if (strcmp ("LASAN", PREFIX) == 0) \ sprintf (LABEL, "*%s%ld", "lASAN", (long)(NUM));\ + else if (strcmp ("LTRAMP", PREFIX) == 0) \ + sprintf (LABEL, "*%s%ld", "lTRAMP", (long)(NUM));\ else \ sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)); \ } while (0)