From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7806 invoked by alias); 11 Oct 2018 18:08:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 7797 invoked by uid 89); 11 Oct 2018 18:08:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=ruppadacorecom, Doug, rupp, sk:rupp@ad X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 11 Oct 2018 18:08:03 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 255C7813A1; Thu, 11 Oct 2018 20:08:00 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y5A5LI8i-RDH; Thu, 11 Oct 2018 20:08:00 +0200 (CEST) Received: from private.gnat.com (unknown [IPv6:2620:20:4000:40:b42c:c767:dc28:fdff]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 93E1B81398; Thu, 11 Oct 2018 20:07:59 +0200 (CEST) From: Olivier Hainque Content-Type: multipart/mixed; boundary="Apple-Mail=_EDDC6B3C-BFC6-47D7-88BC-D3165DE6FF8D" Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: [patch] leverage linker relaxation on ppc vxworks RTPs Message-Id: Date: Thu, 11 Oct 2018 18:22:00 -0000 Cc: Olivier Hainque , Douglas B Rupp To: GCC Patches X-SW-Source: 2018-10/txt/msg00683.txt.bz2 --Apple-Mail=_EDDC6B3C-BFC6-47D7-88BC-D3165DE6FF8D Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-length: 894 Hello, Most VxWorks programs refer to kernel services at some point, and these often end up too far away for short calls on powerpc. This patch, originally contributed by Doug, arranges to request linker relaxation by default for RTPs. This helps many programs transparently, the feature has been available in binutils for a long time now and is more precise than -mlongcall at compile time. We have been using minor variants of this patch in-house successfully for at least couple of years now, I checked that this version has the intended effect on our gcc-8 based version of the toolchain and the patch applies untouched on mainline. Olivier 2018-10-10 Doug Rupp Olivier Hainque * config/rs6000/vxworks.h (VXWORKS_RELAX_LINK_SPEC): New macro. Pass --relax to the linker for RTPs. (LINK_SPEC): Append VXWORKS_RELAX_LINK_SPEC. --Apple-Mail=_EDDC6B3C-BFC6-47D7-88BC-D3165DE6FF8D Content-Disposition: attachment; filename=relax-ppc-rtp.txt Content-Type: text/plain; x-unix-mode=0640; name="relax-ppc-rtp.txt" Content-Transfer-Encoding: quoted-printable Content-length: 671 --- a/gcc/config/rs6000/vxworks.h +++ b/gcc/config/rs6000/vxworks.h @@ -88,8 +88,15 @@ VXWORKS_ADDITIONAL_CPP_SPEC =20 #undef LIB_SPEC #define LIB_SPEC VXWORKS_LIB_SPEC + +/* For RTPs, leverage linker relaxation. This helps programs referring + to, typically, kernel services too far away for short calls. This is m= ore + precise than -mlongcall and can be overriden with -Wl,--no-relax. */ +#define VXWORKS_RELAX_LINK_SPEC "%{mrtp:--relax}" + #undef LINK_SPEC -#define LINK_SPEC VXWORKS_LINK_SPEC +#define LINK_SPEC VXWORKS_LINK_SPEC " " VXWORKS_RELAX_LINK_SPEC + #undef STARTFILE_SPEC #define STARTFILE_SPEC VXWORKS_STARTFILE_SPEC #undef ENDFILE_SPEC --Apple-Mail=_EDDC6B3C-BFC6-47D7-88BC-D3165DE6FF8D--