From patchwork Thu Oct 11 18:07:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Hainque X-Patchwork-Id: 982637 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-487379-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="g9dJ/LM/"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42WJqK0K10z9s7h for ; Fri, 12 Oct 2018 05:08:12 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:mime-version:subject:message-id:date:cc:to; q=dns; s=default; b=jZfuWezsDfC53b0eBuIFq1ZJDidQDe//1RWmvmXGxdegHKFBva PNYD2Mq8gwXcYNP/KxnGlsdwkQEFG0fwQ7HLXTLx3EswQrIWjhQxkqT7Jn7/ZyUo AQ43TcRH/AotBO7CDJ/Tmkn/BhVnTI8YtiekY+bBZo+/bDBKKqfkuB5s4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:mime-version:subject:message-id:date:cc:to; s= default; bh=oiMjmmIWb5U2t67ov07j/BvmZRM=; b=g9dJ/LM/TSkKFdsRaeIU d8Lbl/1kDUI4u8VbNwrD/X4ULxP9DRhyL9NVIbTZwa773GsV+9ZDI2MBWHX6zRCq K30FsP2h4jhMOrhBOg4XaJW6yfHEjKriCVmhGoM9H/EC7ytYF3OsbWWqo+kJnDd6 xQl5X3VbmACJzyv5BTQMNh4= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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 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 14:07:58 -0400 Cc: Olivier Hainque , Douglas B Rupp To: GCC Patches 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. --- a/gcc/config/rs6000/vxworks.h +++ b/gcc/config/rs6000/vxworks.h @@ -88,8 +88,15 @@ VXWORKS_ADDITIONAL_CPP_SPEC #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 more + 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