From patchwork Mon Sep 9 15:44:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173390 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4534173ilq; Mon, 9 Sep 2019 08:46:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4xZDilyRL1A+1TcL9Ky7QmOOUq6AJDBJrT0csEmUOudzoeP28h2ewseeKNEKQ8K2pH5KS X-Received: by 2002:aa7:d34a:: with SMTP id m10mr24447616edr.3.1568043980601; Mon, 09 Sep 2019 08:46:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568043980; cv=none; d=google.com; s=arc-20160816; b=fZ1lrAoMYUqVbp8hveAZz4+xy9upHSMOpo21Ek24TQTQS40570Ri+dx6Z6j/m0fjFe QFzGrKqrXBtfPFjeZ2yL5A9neLSt5fDjM8qftv9z1mIJIZVV1xpfo2RU6P8rf/QmmQE1 3KPeAgQAvZT6OZAO9DkK6NLCRQRzpaDVQdNWx/I3HNIbKWNO5EXrfRoFCjXUEYQK6NRy L6R26GVnDuuFDZZDCu8CvCK6ST76ny2IZt+hnZxmYsZ2mqzfGEdd8jSiEBc4ohISPN+a QMj57YSMYEDvD18oNvYD13ySjElbgdklPY+qQH0wMYfv2R5wtGnC4MWn4lRS+hEBsYzX NKKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=B71ts0sAgrBcNg6EtyntAtalVP20hMPr6iWKfcgfQzI=; b=gQKRJy1VOpYOwnsalBXLU7t9fVKo4cT8cJH3DadCEtxshFvuBMrVZraMHrO0Jn/ldn 6GFlVOGsIOKMjiMIvGXDEJSpSvAJh4GiHTKdSWAPGB+tmuviBXXHcafXWa0anz/+f+P3 KNlY7O3J6WRDphompTHVSyP67aHfVMJkjtAscTu5bGZ/YRouTKxK9fKx5ldYOUfktB84 C3toLgPCdMAalPuN3L+URrrYGaseJTE+kuH4ZIAor9F+D1ql+9k30dYHkrLifK6Wk3qo LSyORhLQ0mGJ/Q27DWc0Gj+7l/GEwzpUvQxL84g/OAmVsMfA/crKtHfPb2GUzRRlEqM1 LROg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=X2v0fEud; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=0xnQ0F8d; spf=pass (google.com: domain of gcc-patches-return-508643-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508643-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id f14si8525990edf.102.2019.09.09.08.46.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:46:20 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508643-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=X2v0fEud; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=0xnQ0F8d; spf=pass (google.com: domain of gcc-patches-return-508643-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508643-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=Nl1 WLEIP72+BS92PifPfAqm5DEmGrWuEvKqjAR4pX5zG+xqWNYlaRfz3d3L4NZLxjor lZlJySuU2Co00JR4nFdJ4qP0XqQdsjEbeAlTBy9GKkt7XXWjJaGgyyyl3ZNVQGC/ ON5cKlnBvAjzMKVtfYikzWcDg92HaMg78KX8VobQ= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=ykygVRnY0 IhUy37+HNqiOJYSinc=; b=X2v0fEudwsn+htwVtC+TkDAHVLFnoAUoKowvSndl2 4sP2g0PrsaVgiWcooE8daYuUguqlotpOZmLFhhKAq5g8irCYWLVDjHVn/CMHoRS5 eCPZ1JEORAvDkN6IHvh6VdBW7+9GXB28Pgpx9jVs6971Ab+olnKMSJC3Ybpc7ovz WU= Received: (qmail 109822 invoked by alias); 9 Sep 2019 15:46:02 -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 109766 invoked by uid 89); 9 Sep 2019 15:46:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Tools, involve X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:46:00 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89Ff36I031790 for ; Mon, 9 Sep 2019 17:45:57 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=B71ts0sAgrBcNg6EtyntAtalVP20hMPr6iWKfcgfQzI=; b=0xnQ0F8dzJp889Er7bEt6cegKqEd/cipE6ZyKs/EoJKdvgGSpz/hT4LGKJlv+TysT35o tj9NTbEiw3XNSceI8KXs91UIZpEIbVRE1/gJ3/vPD5Ur8Zv66oVgHDhrfss6Mk4Treoj KB6cj/Gc1SuTdYjYwsXdB6zcvoJfxMiWJu536Lmo/qMKQ+cOucEGdxO4xlfJiWCbWJIL 8IHfi4WOiarZRwRYMed0MwBFCe+dncnpzX9qVJPa8yCiVKdF3SQg63NqwFXnVlfGAeqq dp8ibnWwOp3l2PnzQTeJwDn8NxuFS7wXZHpQBCKsszAsoneMNWKdUilnHqRQuk9EauGj IA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv3ehpj63-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:45:57 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 0CF5722 for ; Mon, 9 Sep 2019 15:45:54 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 453C92B9BC5 for ; Mon, 9 Sep 2019 17:45:53 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:45:53 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 01/24] [ARM] FDPIC: Add -mfdpic option support Date: Mon, 9 Sep 2019 17:44:43 +0200 Message-ID: <20190909154526.11630-2-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.opt: Add -mfdpic option. * doc/invoke.texi: Add documentation for -mfdpic. Change-Id: I05b98d6ae87c2b3fc04dd7fba415c730accdf33e -- 2.6.3 diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt index 5ecc5e5..545ec49 100644 --- a/gcc/config/arm/arm.opt +++ b/gcc/config/arm/arm.opt @@ -306,3 +306,7 @@ Cost to assume for a branch insn. mgeneral-regs-only Target Report RejectNegative Mask(GENERAL_REGS_ONLY) Save Generate code which uses the core registers only (r0-r14). + +mfdpic +Target Report Mask(FDPIC) +Enable Function Descriptor PIC mode. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index bfcd76e..cc283ff 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -711,7 +711,8 @@ Objective-C and Objective-C++ Dialects}. -mrestrict-it @gol -mverbose-cost-dump @gol -mpure-code @gol --mcmse} +-mcmse @gol +-mfdpic} @emph{AVR Options} @gccoptlist{-mmcu=@var{mcu} -mabsdata -maccumulate-args @gol @@ -18043,6 +18044,27 @@ MOVT instruction. Generate secure code as per the "ARMv8-M Security Extensions: Requirements on Development Tools Engineering Specification", which can be found on @url{http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf}. + +@item -mfdpic +@itemx -mno-fdpic +@opindex mfdpic +@opindex mno-fdpic +Select the FDPIC ABI, which uses 64-bit function descriptors to +represent pointers to functions. When the compiler is configured for +@code{arm-*-uclinuxfdpiceabi} targets, this option is on by default +and implies @option{-fPIE} if none of the PIC/PIE-related options is +provided. On other targets, it only enables the FDPIC-specific code +generation features, and the user should explicitly provide the +PIC/PIE-related options as needed. + +Note that static linking is not supported because it would still +involve the dynamic linker when the program self-relocates. If such +behavior is acceptable, use -static and -Wl,-dynamic-linker options. + +The opposite @option{-mno-fdpic} option is useful (and required) to +build the Linux kernel using the same (@code{arm-*-uclinuxfdpiceabi}) +toolchain as the one used to build the userland programs. + @end table @node AVR Options From patchwork Mon Sep 9 15:44:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173391 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4534504ilq; Mon, 9 Sep 2019 08:46:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzk3dhF1hgJpMILx6YVtQWe+BDu2xJM5R7VmqyF8tJr85MzaoXo76rxx45/mvBTU3ydjCOM X-Received: by 2002:a50:fd95:: with SMTP id o21mr24809800edt.6.1568043997591; Mon, 09 Sep 2019 08:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568043997; cv=none; d=google.com; s=arc-20160816; b=vVFuq5mtQDp3gIOW7sdKC1wgZgp5J6dLX/Skz5azv2ykYKOnpw9SXf/D+z2wHr7czA ToNi8qJ7IEGMDVFX1MNG0drM2behdXcbhrdQP69f+z1WtWpJF83WHz3lwJuro7pXRrZd lkUDEHYe+EdXoKgy46RGqyiG9UgB3gXS4s4MD/+vORzotOvn9gOFKDNc6JZXTi0pNL7D v2H7JsbszaktUXHZf74/DGliHzvqOExazTdtcQFV883qZW1lXce2KGMx2fvYoPcUljTV iAMMhRGiRVIvxERswt6+IfX8teBunjbHm+9nVdDoj1sH4GprVqZCPYWfKWKEBiwjwtVZ IIVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=ivICdiNmJlxK2UVAdpAJrRLxK/sHbXz6eoym5bsjkmA=; b=ZMEwye/mWMF2O7loukzUhJK4Q/JQb/GZV7z6WeslzXvCDJflea9KCGOgBHoVlhAlM1 hbMs7x4TIbSHXqrazJVP05G0zjkMkZsGXXO0ssYVkQ0cjW7BPjz2MEQuM7Y7l1iLer3l eHQ6UOGUNlPIV67d2elkW6hhBQP/3kOwa6+eoqyiLQ/OJOVbMfMzGnb0/7sly+ZPtv2L kMsCzs6qbDAuDid+m06S7YUgSWM/uSP/Cb9JwgsPW/ygcRzDFisFOyJ7u5u52Guw7mxt +qmgFHB4VINdr7qmjoipAdlhrJ2aKxyoMVttWZSfuATXRxjo+56qZuj4T3oXYh/EKy2L zVNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uWKTtel3; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=sv6tnkWw; spf=pass (google.com: domain of gcc-patches-return-508644-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508644-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id s41si9297190edm.412.2019.09.09.08.46.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:46:37 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508644-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uWKTtel3; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=sv6tnkWw; spf=pass (google.com: domain of gcc-patches-return-508644-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508644-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=dkCxF2XxA/bFfBGBC/EUHXfXT4dud 3ACeSyk9bsIJy8k92l+w5yFnNEf8ZpVOKtxY0EzEeQZsCkJOVFb5sAcDrIfugHCk zqbvrrKORR6qPfKL1Kt4BOyNLsynf07N28/CEOCdT3NqjRptzqpUuZXJobaq9T1v zkQgxk3KXkhGxo= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=rBsXjtNZbyGHmHR4BWCrBAC5SxY=; b=uWK Ttel3oosBmQQv2n4r+tM2DGVB1RSJbn4sbgNeLUo5uvGSg3ak6t+0YcjswyDRcNF hCc+/RWNnPtZVbYFSRO868LHmvrGw4GnZ9H+EHppQHGWAcL9Iu4H07YLYI5WSSFr 19QFVgfLOow1bSb5LuOudES0qrIjYAdU0/uz9h3Y= Received: (qmail 111885 invoked by alias); 9 Sep 2019 15:46:22 -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 111867 invoked by uid 89); 9 Sep 2019 15:46:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Shared, $CC, $cc, CC X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:46:19 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkBAT003543 for ; Mon, 9 Sep 2019 17:46:17 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=ivICdiNmJlxK2UVAdpAJrRLxK/sHbXz6eoym5bsjkmA=; b=sv6tnkWwbHWaEQ4acv7Br8hMra8h/55ApjBaO12OjH6Ro2TmyeN816us5kAIQl+6vDlM B81xsfs1DNWMOOqPhOJXljNzY8crbKBODVcyHm/DDW5V6IdtS6LQMB11kK6JBCePV3Qn uJi8kwc8oZ0Gu2YAbl+4pO4XFx0D4qUG/fnoqeU9Np5uLBJ4T5ZXGsqa9UmGeLAGvrZ9 g/XTIgY/oyezVLTMq/cXkRKEn/rztgPGAPb3cxnKLeC8iXTnOYYhuPl1bMOy9jcnk6XT 8nrHVvF//BOImiI5e4ytk8MHznOHnMKlZIaVUCU0Htt+y3qp0CQhajZFRYpExy6ya4Vt 2A== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa707u-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:46:17 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 1C7F04D for ; Mon, 9 Sep 2019 15:46:14 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 7E5FB2B9BC6 for ; Mon, 9 Sep 2019 17:46:13 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:46:13 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts Date: Mon, 9 Sep 2019 17:44:44 +0200 Message-ID: <20190909154526.11630-3-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon The new arm-uclinuxfdpiceabi target behaves pretty much like arm-linux-gnueabi. In order to enable the same set of features, we have to update several configure scripts that generally match targets like *-*-linux*: in most places, we add *-uclinux* where there is already *-linux*, or uclinux* when there is already linux*. In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi because there is already a different behaviour for *-*uclinux* target. In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared libraries support is required, as uclinux does not guarantee that. 2019-XX-XX Christophe Lyon config/ * futex.m4: Handle *-uclinux*. * tls.m4 (GCC_CHECK_TLS): Likewise. gcc/ * config.gcc: Handle *-*-uclinuxfdpiceabi. libatomic/ * configure.tgt: Handle arm*-*-uclinux*. * configure: Regenerate. libgcc/ * config.host: Handle *-*-uclinuxfdpiceabi. libitm/ * configure.tgt: Handle *-*-uclinux*. * configure: Regenerate. * libtool.m4: Handle uclinuxfdpiceabi. Change-Id: Ib3a08905879ef917ee6c04c3988cf4ced7209fef -- 2.6.3 diff --git a/config/futex.m4 b/config/futex.m4 index 1b43829..c212438 100644 --- a/config/futex.m4 +++ b/config/futex.m4 @@ -9,7 +9,7 @@ AC_DEFUN([GCC_LINUX_FUTEX],[dnl GCC_ENABLE(linux-futex,default, ,[use the Linux futex system call], permit yes|no|default) case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then diff --git a/config/tls.m4 b/config/tls.m4 index 1a5fc59..7532305 100644 --- a/config/tls.m4 +++ b/config/tls.m4 @@ -76,7 +76,7 @@ AC_DEFUN([GCC_CHECK_TLS], [ dnl Shared library options may depend on the host; this check dnl is only known to be needed for GNU/Linux. case $host in - *-*-linux*) + *-*-linux* | -*-uclinuxfdpic*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac diff --git a/gcc/config.gcc b/gcc/config.gcc index 94a3608..69904fd 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -771,7 +771,7 @@ case ${target} in *-*-fuchsia*) native_system_header_dir=/include ;; -*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) +*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) extra_options="$extra_options gnu-user.opt" gas=yes gnu_ld=yes @@ -800,7 +800,7 @@ case ${target} in *-*-*android*) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC" ;; - *-*-*uclibc*) + *-*-*uclibc* | *-*-uclinuxfdpiceabi) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" ;; *-*-*musl*) @@ -1198,7 +1198,7 @@ arm*-*-netbsdelf*) armv7*) target_cpu_cname="generic-armv7-a";; esac ;; -arm*-*-linux-*) # ARM GNU/Linux with ELF +arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" extra_options="${extra_options} linux-android.opt" case $target in diff --git a/libatomic/configure b/libatomic/configure index e6f5fb7..7bd01a1 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -6055,7 +6055,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -9135,7 +9135,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -10666,7 +10666,12 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) + +# uclinux* changes (here and below) have been submitted to the libtool +# project, but have not yet been accepted: they are GCC-local changes +# for the time being. (See +# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt index 4a1294b..61778fb 100644 --- a/libatomic/configure.tgt +++ b/libatomic/configure.tgt @@ -124,7 +124,7 @@ case "${target}" in config_path="${config_path} linux/aarch64 posix" ;; - arm*-*-linux*) + arm*-*-linux* | arm*-*-uclinux*) # OS support for atomic primitives. config_path="${config_path} linux/arm posix" ;; diff --git a/libgcc/config.host b/libgcc/config.host index 1db5287..bfe5952 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -245,7 +245,7 @@ case ${host} in tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-fuchsia" extra_parts="crtbegin.o crtend.o" ;; -*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) +*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" if test x$enable_vtable_verify = xyes; then @@ -450,7 +450,7 @@ arm*-*-netbsdelf*) ;; esac ;; -arm*-*-linux*) # ARM GNU/Linux with ELF +arm*-*-linux* | arm*-*-uclinuxfdpiceabi) tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm" tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" tm_file="$tm_file arm/bpabi-lib.h" diff --git a/libitm/configure b/libitm/configure old mode 100644 new mode 100755 index c466ae0..5315fab --- a/libitm/configure +++ b/libitm/configure @@ -6731,7 +6731,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -9812,7 +9812,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -11343,7 +11343,12 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) + +# uclinux* changes (here and below) have been submitted to the libtool +# project, but have not yet been accepted: they are GCC-local changes +# for the time being. (See +# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -15003,7 +15008,12 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) + +# uclinux* changes (here and below) have been submitted to the libtool +# project, but have not yet been accepted: they are GCC-local changes +# for the time being. (See +# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -16468,7 +16478,7 @@ fi case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then @@ -16593,7 +16603,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinuxfdpic*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac diff --git a/libitm/configure.tgt b/libitm/configure.tgt index 4c0b602..eea865d 100644 --- a/libitm/configure.tgt +++ b/libitm/configure.tgt @@ -127,7 +127,7 @@ config_path="$ARCH posix generic" # Other system configury case "${target}" in - *-*-linux*) + *-*-linux* | *-*-uclinux*) if test "$enable_linux_futex" = yes; then config_path="linux/$ARCH linux $config_path" fi diff --git a/libtool.m4 b/libtool.m4 index 8966762..e194e89 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -2449,7 +2449,12 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) + +# uclinux* changes (here and below) have been submitted to the libtool +# project, but have not yet been accepted: they are GCC-local changes +# for the time being. (See +# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -3089,7 +3094,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -4449,7 +4454,7 @@ _LT_EOF _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in From patchwork Mon Sep 9 15:44:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173392 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4534971ilq; Mon, 9 Sep 2019 08:46:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4S16+tE0khglrmAP8dTzFF1qb3w8nzOT6V/CthOVbUBqF3YZ9WYYZ9qLH4uqOdKqjtMhX X-Received: by 2002:aa7:da8b:: with SMTP id q11mr24950870eds.19.1568044019889; Mon, 09 Sep 2019 08:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044019; cv=none; d=google.com; s=arc-20160816; b=NoJboMUL9olN/Ja/Ko02GoPBmoQMHtGrIxz1L+NhvSp7B4JTOwWnFeQ7W9v5C82Jct 1F/RkkeHrQF+HmUwFp6+FAxirHmkwnvMQ4vYVcF6a7K/sGMYAb1rOwMCs94x8GA5F5Lj zF8Xu+kcHAI4PB/Ml/qEx0qGClVakmGlIGIpdd4Uddcqqhu8EMUOidnH4FdId/M4VmIc l5Y1i53RKXR0wLrT3DDdcPmvCgS766KWNxVAgPBoC3uxzIiWGBUGRtel/yz23UFuUkWp QcjMITR8q8rpBztBXs4C4khq09maAUsxEA4EEqCmcYO0hdXD9rd082gOCbMWAnXcvTqx EBDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=msFjZApsUqI6yomSYB7PGt0ODu+kVLdK3ralH3/PEoU=; b=RmdgRBPegztp7yWSP0WeR93z6eV3cnOrHuUsMpFYeWmq4S0LW0ZWW/qOdTesPYbI+e qHi/XvIQkqZX4BHtcNcLrtztSefh2CDPlaMkiKKMreMiV9jwQBJOLP59ctlo1Ugi20Fp APtqxtSwXelnK5+GC+0HAeTAjX5FFz/ZAsNvsouK0smE2TALBeRsW8bDXQFo+UgLdq9a zc/EO8kTivdtAwZ+1VAFnHJVUsLjaVvl3P32lkPJDmkbYe8n/TBx2fEEFCxqpZAQCtPD Kg+bovb3Yg+jO45JSOnhITCMy8m0lRcAqWxlCqVYQ3x7KfFZHV0HM9qcXOXx0EGMdmZ8 lWUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XkWuWmkk; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=OzziAZpb; spf=pass (google.com: domain of gcc-patches-return-508645-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508645-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b2si7901517ejv.318.2019.09.09.08.46.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:46:59 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508645-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XkWuWmkk; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=OzziAZpb; spf=pass (google.com: domain of gcc-patches-return-508645-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508645-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=ruN tLotjQVaiXaX+J6MA2ccaQAYqlV7xVjjYfCMD74E/6Q1C2AIPEGJKrpoB7YCm/PL NaZoDG20RgwRDhjVJ8/U+vHZbOGy+XYzWSBfjmrhbJEkzKhMQOaOutRQwcf7tAOF L3zrfKX/oN3xKN7/sAPPmT1yYNzhJbtdh0qu+6Es= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=t4pckgjU/ t/cZyTniuEIk1NW3MI=; b=XkWuWmkk31OMpV+okGz16P0Rqdpx47lJssaK4XCIL VcFRGx1LHys6JHHDJ7dql7v7/UotR4qH2c5VNdkXpjaERNxxpqUmtasr5QkI/h18 vfmcukSc8NtXvAPV/vSZzE3XYVJGtjeTderSGFeemZEYxSi5M51dJ5N4DxY7nIhM LQ= Received: (qmail 113411 invoked by alias); 9 Sep 2019 15:46:46 -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 113403 invoked by uid 89); 9 Sep 2019 15:46:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:46:45 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkgaM027615 for ; Mon, 9 Sep 2019 17:46:42 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=msFjZApsUqI6yomSYB7PGt0ODu+kVLdK3ralH3/PEoU=; b=OzziAZpbVopeGo9aeouoUEjsRqAw7529YSo1OYtNH7YPRC/9Mipi8yAZlz8TzpVTOVLL 2fyTn30T+lh8QI5DRM4mvOtmCiN0ayq4HYxNIkozKpTmh+jvFRDmNXpuRWA1/38l3nCI vOg7SJmvbacLTvS2kXzmr7YOTpefxPQjwDrj/fbfnJvdUANTbGsbNfWle5xmvSmUpq3e zSloR+sN0RWLyUVNNkfCREgKVaiyoalHXvBWI0XXscJfD7SY2OusPBAUCYvDxpPY5oiY C5pKxDNRy2wa6AZfIPsD5dMkdoTmmuwXUMuJOQlHV4qZ3x8settNh4gD1oyYswQmAbN1 KQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv3ehpjb5-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:46:42 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 41AAB4C for ; Mon, 9 Sep 2019 15:46:34 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A2DB32B9BCE for ; Mon, 9 Sep 2019 17:46:33 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:46:33 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 03/24] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is provided Date: Mon, 9 Sep 2019 17:44:45 +0200 Message-ID: <20190909154526.11630-4-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon In FDPIC mode, we set -fPIE unless the user provides -fno-PIE, -fpie, -fPIC or -fpic: indeed FDPIC code is PIC, but we want to generate code for executables rather than shared libraries by default. We also make sure to use the --fdpic assembler option, and select the appropriate linker emulation. At link time, we also default to -pie, unless we are generating a shared library or a relocatable file (-r). Note that static link is not supported as it requires specifying the dynamic linker because the executable still has to relocate itself at startup. We also force 'now' binding since lazy binding is not supported. We should also apply the same behavior for -Wl,-Ur as for -r, but I couldn't find how to describe that in the specs fragment. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config.gcc: Handle arm*-*-uclinuxfdpiceabi. * config/arm/bpabi.h (TARGET_FDPIC_ASM_SPEC): New. (SUBTARGET_EXTRA_ASM_SPEC): Use TARGET_FDPIC_ASM_SPEC. * config/arm/linux-eabi.h (FDPIC_CC1_SPEC): New. (CC1_SPEC): Use FDPIC_CC1_SPEC. (MUSL_DYNAMIC_LINKER): Add -fdpic suffix when needed. * config/arm/uclinuxfdpiceabi.h: New file. libsanitizer/ * configure.tgt (arm*-*-*fdpiceabi): Sanitizers are unsupported in this configuration. Change-Id: I74ac1fbb2e809e864d2b0acce66b173e76bcf92b -- 2.6.3 diff --git a/gcc/config.gcc b/gcc/config.gcc index 69904fd..2a6a8f0 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1208,6 +1208,11 @@ arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) esac tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi" tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h arm/arm.h" + case $target in + arm*-*-uclinuxfdpiceabi) + tm_file="$tm_file arm/uclinuxfdpiceabi.h" + ;; + esac # Generation of floating-point instructions requires at least ARMv5te. if [ "$with_float" = "hard" -o "$with_float" = "softfp" ] ; then target_cpu_cname="arm10e" diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h index e1bacf4..75d9a99 100644 --- a/gcc/config/arm/bpabi.h +++ b/gcc/config/arm/bpabi.h @@ -55,6 +55,8 @@ #define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" +#define TARGET_FDPIC_ASM_SPEC "" + #define BE8_LINK_SPEC \ "%{!r:%{!mbe32:%:be8_linkopt(%{mlittle-endian:little}" \ " %{mbig-endian:big}" \ @@ -64,7 +66,8 @@ /* Tell the assembler to build BPABI binaries. */ #undef SUBTARGET_EXTRA_ASM_SPEC #define SUBTARGET_EXTRA_ASM_SPEC \ - "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC + "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC \ + TARGET_FDPIC_ASM_SPEC #ifndef SUBTARGET_EXTRA_LINK_SPEC #define SUBTARGET_EXTRA_LINK_SPEC "" diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h index 66ec0ea..b348971 100644 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -89,7 +89,7 @@ #define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}" #endif #define MUSL_DYNAMIC_LINKER \ - "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1" /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to use the GNU/Linux version, not the generic BPABI version. */ @@ -101,9 +101,12 @@ #undef ASAN_CC1_SPEC #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}" +#define FDPIC_CC1_SPEC "" + #undef CC1_SPEC #define CC1_SPEC \ - LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC, \ + LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \ + FDPIC_CC1_SPEC, \ GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \ ANDROID_CC1_SPEC) diff --git a/gcc/config/arm/uclinuxfdpiceabi.h b/gcc/config/arm/uclinuxfdpiceabi.h new file mode 100644 index 0000000..328adcb --- /dev/null +++ b/gcc/config/arm/uclinuxfdpiceabi.h @@ -0,0 +1,54 @@ +/* Configuration file for ARM GNU/Linux FDPIC EABI targets. + Copyright (C) 2018,2019 Free Software Foundation, Inc. + Contributed by STMicroelectronics. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +/* On uClibc EABI GNU/Linux, we want to force -mfdpic by default, + which also means we produce PIE code by default. */ +#undef FDPIC_CC1_SPEC +#define FDPIC_CC1_SPEC \ + "%{!mno-fdpic:-mfdpic %{!fno-PIE:%{!fpie:%{!fPIC:%{!fpic: -fPIE}}}}}" + +/* Add --fdpic assembler flag by default. */ +#undef TARGET_FDPIC_ASM_SPEC +#define TARGET_FDPIC_ASM_SPEC "%{!mno-fdpic: --fdpic}" + +/* TARGET_BIG_ENDIAN_DEFAULT is set in + config.gcc for big endian configurations. */ +#if TARGET_BIG_ENDIAN_DEFAULT +#define TARGET_FDPIC_LINKER_EMULATION "armelfb_linux_fdpiceabi" +#else +#define TARGET_FDPIC_LINKER_EMULATION "armelf_linux_fdpiceabi" +#endif + +/* Unless we generate a shared library or a relocatable object, we + force -pie. */ +/* -static is not supported, because we have to define the + dynamic-linker, as we have some relocations to resolve at load + time. We do not generate an error in case the user explictly passes + the -dynamic-linker option to the linker. */ +#undef SUBTARGET_EXTRA_LINK_SPEC +#define SUBTARGET_EXTRA_LINK_SPEC \ + "%{!mno-fdpic: -m " TARGET_FDPIC_LINKER_EMULATION \ + "%{!shared:%{!r: -pie}} }" \ + "%{mno-fdpic: -m " TARGET_LINKER_EMULATION "}" \ + "%{!r:%{!mno-fdpic: -z now}}" + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "%{!mno-fdpic:%{!shared:crtreloc.o%s}} " \ + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC) diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt index 3fb90ea..714f292 100644 --- a/libsanitizer/configure.tgt +++ b/libsanitizer/configure.tgt @@ -42,6 +42,9 @@ case "${target}" in ;; sparc*-*-solaris2.11*) ;; + arm*-*-*fdpiceabi) + UNSUPPORTED=1 + ;; arm*-*-linux*) ;; mips*64*-*-linux*) From patchwork Mon Sep 9 15:44:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173393 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4535365ilq; Mon, 9 Sep 2019 08:47:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcIuwjEwaZbDlbTKQ9CPp4+RZcb3V8cCmzK4hKXWBsDQHYUqq59bJIDijyWtfYVxzW73Zh X-Received: by 2002:aa7:d5cb:: with SMTP id d11mr25459100eds.250.1568044041220; Mon, 09 Sep 2019 08:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044041; cv=none; d=google.com; s=arc-20160816; b=aetZNSbTU2/mzqnhTkquzspRFJpyCtDKmp2ZbvmF9U4xHLiWLYkd4204ySg5Ev/ocl xcAULWW3qfvIA1rjO4gktqnXFH4uERzR5jWcVvIEsEBNfdXVgai63Sp5hizIwyh3CXDA V/J91ecc0ldqwsmIT/Ljss0Sn8pWaXsWauKDSwG+Lrd9RQkKCllq2nL1uuKXWFXXOpII NB2gZNWffAB0m+6XctvupsRSElIoSPc9MDek3Po348j6XJUDh5sMTbVhhl4/bTmlD2iy o0zU2vEiCuXBi7c/2A0z//lmnNHANcrzrvHoJFHtl+MHeddsYKmYoDcG6bZ09qtPBRKf EH4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=sHqBuws+U4sZgFQnPy0bOSp+RU+GMyPrGIvelY35shg=; b=F/pqdEB63dt9Wcs9h0huhYU+sRAjh5CzBONcDxtzrmzqw5xakkmc6WCR5cKLk3/KY4 uNmpToUdHYJ0hAHxRM6RXsAvgfyThd8BaSisEAwSvlLzCD2VUHkqBOGYvQYjyK/mkK1M 2BEh0W+NuKWnSfl6QiOxEUODFbcvIabteWqDlZYed5fLK6q21RMGN8VBNrCaHrZA3yfg hzRGjwBfJDXbNVciYC1yMMbjM2GbI9ibvIygNYKmAsC/cGojy/bEA5Tr0xBG1L0/j9de NVm0L+iZWIhzxt2MT2fA5NERiV2DWH0DKJPnouA+qqxze9Kd2Dqv7mcRdUBIBRQg2bvi zLrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VLSpLou0; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=d9rZL8Ux; spf=pass (google.com: domain of gcc-patches-return-508646-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508646-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z11si2398737ejo.299.2019.09.09.08.47.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:47:21 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508646-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VLSpLou0; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=d9rZL8Ux; spf=pass (google.com: domain of gcc-patches-return-508646-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508646-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=jxi ZtM7wKz5IOa+2FJsL7Fvt1ab1lkvIGC1sO6PE3wV7dVui6JV3idj/VzCFgd5rVj4 rQGVpgXLfOVtkZKyRQdWE5865JgJRgByrrDwETJG2IiB9XXrHJR3Oh61fI4dUKpC ygRgzJFEfW6xBhLEXn1n2UR8Q/xYO5qnUQFnA858= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=NNL9riMdb 1rsHc2+IMFb+3ZFyvA=; b=VLSpLou0NbQh/Cy+izNJoxkfPzawIe4h1hGetoGqv /LK39n0zU1V4r2/VKAiq9T3tZC72u1UkZYZ7+HCBF6UVMpEOj7OT7d3Z9sAyrV13 h4N2QL9OokLLtKsTTztcU0EE6ypTqGK0MQsJE4jQRjNEaX2j2Ci6axb2f/9EDhom k8= Received: (qmail 115094 invoked by alias); 9 Sep 2019 15:47:05 -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 115086 invoked by uid 89); 9 Sep 2019 15:47:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=rm X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:47:01 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkMTq001843 for ; Mon, 9 Sep 2019 17:46:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=sHqBuws+U4sZgFQnPy0bOSp+RU+GMyPrGIvelY35shg=; b=d9rZL8UxWRmlmCuyy4PDyWeu74e9ipRc0PHiGNPA2VWTkH7TQmUSkXzYChB7QViksnvH 8oUcZqGYA/4EXi8ms9SdF8VNctdDlqtyxQHw4E7sEDByASeYdeAsuSJeVRXb+Ko257S8 D5Ph0B25LdcWg/3G2Km0+VCREq7AmtNWYFWaFHMJcVgai+de6bJmX6jkUvMVoihEn0KV PqKWFUH/Aw5cuzvbPvXbVgCIj7a13FT0Q01pnLDoaBkzlN20Kx+itpR1vhXi7RDicOsQ ry2L9chiSJmRncX1ItFly9yp1gXUKIJmFSAGynt2DdTQT5xgiru66Q70fGChT8PgXADz 3A== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv2avxh1j-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:46:57 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 7C1484B for ; Mon, 9 Sep 2019 15:46:54 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id DC4A52B9BCB for ; Mon, 9 Sep 2019 17:46:53 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:46:53 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 04/24] [ARM] FDPIC: Add support for FDPIC for arm architecture Date: Mon, 9 Sep 2019 17:44:46 +0200 Message-ID: <20190909154526.11630-5-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon The FDPIC register is hard-coded to r9, as defined in the ABI. We have to disable tailcall optimizations if we don't know if the target function is in the same module. If not, we have to set r9 to the value associated with the target module. When generating a symbol address, we have to take into account whether it is a pointer to data or to a function, because different relocations are needed. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm-c.c (__FDPIC__): Define new pre-processor macro in FDPIC mode. * config/arm/arm-protos.h (arm_load_function_descriptor): Declare new function. * config/arm/arm.c (arm_option_override): Define pic register to FDPIC_REGNUM. (arm_function_ok_for_sibcall): Disable sibcall optimization if we have no decl or go through PLT. (calculate_pic_address_constant): New function. (legitimize_pic_address): Call calculate_pic_address_constant. (arm_load_pic_register): Handle TARGET_FDPIC. (arm_is_segment_info_known): New function. (arm_pic_static_addr): Add support for FDPIC. (arm_load_function_descriptor): New function. (arm_emit_call_insn): Add support for FDPIC. (arm_assemble_integer): Add support for FDPIC. * config/arm/arm.h (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED): Define. (FDPIC_REGNUM): New define. * config/arm/arm.md (call): Add support for FDPIC. (call_value): Likewise. (restore_pic_register_after_call): New pattern. (untyped_call): Disable if FDPIC. (untyped_return): Likewise. * config/arm/unspecs.md (UNSPEC_PIC_RESTORE): New. gcc/testsuite/ * gcc.target/arm/fp16-aapcs-2.c: Adjust scan-assembler-times. * gcc.target/arm/fp16-aapcs-4.c: Likewise. Change-Id: I1e96d260074ab7b75d36cdff5d34ad898f35c66f -- 2.6.3 diff --git a/gcc/config/arm/arm-c.c b/gcc/config/arm/arm-c.c index 6e256ee..34695fa 100644 --- a/gcc/config/arm/arm-c.c +++ b/gcc/config/arm/arm-c.c @@ -203,6 +203,8 @@ arm_cpu_builtins (struct cpp_reader* pfile) builtin_define ("__ARM_EABI__"); } + def_or_undef_macro (pfile, "__FDPIC__", TARGET_FDPIC); + def_or_undef_macro (pfile, "__ARM_ARCH_EXT_IDIV__", TARGET_IDIV); def_or_undef_macro (pfile, "__ARM_FEATURE_IDIV", TARGET_IDIV); diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index 8386d89..f995974 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -139,6 +139,7 @@ extern int arm_max_const_double_inline_cost (void); extern int arm_const_double_inline_cost (rtx); extern bool arm_const_double_by_parts (rtx); extern bool arm_const_double_by_immediates (rtx); +extern rtx arm_load_function_descriptor (rtx funcdesc); extern void arm_emit_call_insn (rtx, rtx, bool); bool detect_cmse_nonsecure_call (tree); extern const char *output_call (rtx *); diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 8576431..c34aab8 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3456,6 +3456,14 @@ arm_option_override (void) if (flag_pic && TARGET_VXWORKS_RTP) arm_pic_register = 9; + /* If in FDPIC mode then force arm_pic_register to be r9. */ + if (TARGET_FDPIC) + { + arm_pic_register = FDPIC_REGNUM; + if (TARGET_THUMB1) + sorry ("FDPIC mode is not supported in Thumb-1 mode"); + } + if (arm_pic_register_string != NULL) { int pic_register = decode_reg_name (arm_pic_register_string); @@ -7251,6 +7259,15 @@ arm_function_ok_for_sibcall (tree decl, tree exp) if (cfun->machine->sibcall_blocked) return false; + if (TARGET_FDPIC) + { + /* In FDPIC, never tailcall something for which we have no decl: + the target function could be in a different module, requiring + a different FDPIC register value. */ + if (decl == NULL) + return false; + } + /* Never tailcall something if we are generating code for Thumb-1. */ if (TARGET_THUMB1) return false; @@ -7461,6 +7478,24 @@ require_pic_register (rtx pic_reg, bool compute_now) } } +/* Generate insns to calculate the address of ORIG in pic mode. */ +static rtx_insn * +calculate_pic_address_constant (rtx reg, rtx pic_reg, rtx orig) +{ + rtx pat; + rtx mem; + + pat = gen_calculate_pic_address (reg, pic_reg, orig); + + /* Make the MEM as close to a constant as possible. */ + mem = SET_SRC (pat); + gcc_assert (MEM_P (mem) && !MEM_VOLATILE_P (mem)); + MEM_READONLY_P (mem) = 1; + MEM_NOTRAP_P (mem) = 1; + + return emit_insn (pat); +} + /* Legitimize PIC load to ORIG into REG. If REG is NULL, a new pseudo is created to hold the result of the load. If not NULL, PIC_REG indicates which register to use as PIC register, otherwise it is decided by register @@ -7505,24 +7540,13 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg, rtx pic_reg, insn = arm_pic_static_addr (orig, reg); else { - rtx pat; - rtx mem; - /* If this function doesn't have a pic register, create one now. */ require_pic_register (pic_reg, compute_now); if (pic_reg == NULL_RTX) pic_reg = cfun->machine->pic_reg; - pat = gen_calculate_pic_address (reg, pic_reg, orig); - - /* Make the MEM as close to a constant as possible. */ - mem = SET_SRC (pat); - gcc_assert (MEM_P (mem) && !MEM_VOLATILE_P (mem)); - MEM_READONLY_P (mem) = 1; - MEM_NOTRAP_P (mem) = 1; - - insn = emit_insn (pat); + insn = calculate_pic_address_constant (reg, pic_reg, orig); } /* Put a REG_EQUAL note on this insn, so that it can be optimized @@ -7677,7 +7701,9 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED, rtx pic_reg) { rtx l1, labelno, pic_tmp, pic_rtx; - if (crtl->uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE) + if (crtl->uses_pic_offset_table == 0 + || TARGET_SINGLE_PIC_BASE + || TARGET_FDPIC) return; gcc_assert (flag_pic); @@ -7746,28 +7772,128 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED, rtx pic_reg) emit_use (pic_reg); } +/* Try to determine whether an object, referenced via ORIG, will be + placed in the text or data segment. This is used in FDPIC mode, to + decide which relocations to use when accessing ORIG. *IS_READONLY + is set to true if ORIG is a read-only location, false otherwise. + Return true if we could determine the location of ORIG, false + otherwise. *IS_READONLY is valid only when we return true. */ +static bool +arm_is_segment_info_known (rtx orig, bool *is_readonly) +{ + *is_readonly = false; + + if (GET_CODE (orig) == LABEL_REF) + { + *is_readonly = true; + return true; + } + + if (SYMBOL_REF_P (orig)) + { + if (CONSTANT_POOL_ADDRESS_P (orig)) + { + *is_readonly = true; + return true; + } + if (SYMBOL_REF_LOCAL_P (orig) + && !SYMBOL_REF_EXTERNAL_P (orig) + && SYMBOL_REF_DECL (orig) + && (!DECL_P (SYMBOL_REF_DECL (orig)) + || !DECL_COMMON (SYMBOL_REF_DECL (orig)))) + { + tree decl = SYMBOL_REF_DECL (orig); + tree init = (TREE_CODE (decl) == VAR_DECL) + ? DECL_INITIAL (decl) : (TREE_CODE (decl) == CONSTRUCTOR) + ? decl : 0; + int reloc = 0; + bool named_section, readonly; + + if (init && init != error_mark_node) + reloc = compute_reloc_for_constant (init); + + named_section = TREE_CODE (decl) == VAR_DECL + && lookup_attribute ("section", DECL_ATTRIBUTES (decl)); + readonly = decl_readonly_section (decl, reloc); + + /* We don't know where the link script will put a named + section, so return false in such a case. */ + if (named_section) + return false; + + *is_readonly = readonly; + return true; + } + + /* We don't know. */ + return false; + } + + gcc_unreachable (); +} + /* Generate code to load the address of a static var when flag_pic is set. */ static rtx_insn * arm_pic_static_addr (rtx orig, rtx reg) { rtx l1, labelno, offset_rtx; + rtx_insn *insn; gcc_assert (flag_pic); - /* We use an UNSPEC rather than a LABEL_REF because this label - never appears in the code stream. */ - labelno = GEN_INT (pic_labelno++); - l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); - l1 = gen_rtx_CONST (VOIDmode, l1); + bool is_readonly = false; + bool info_known = false; - /* On the ARM the PC register contains 'dot + 8' at the time of the - addition, on the Thumb it is 'dot + 4'. */ - offset_rtx = plus_constant (Pmode, l1, TARGET_ARM ? 8 : 4); - offset_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, orig, offset_rtx), - UNSPEC_SYMBOL_OFFSET); - offset_rtx = gen_rtx_CONST (Pmode, offset_rtx); + if (TARGET_FDPIC + && SYMBOL_REF_P (orig) + && !SYMBOL_REF_FUNCTION_P (orig)) + info_known = arm_is_segment_info_known (orig, &is_readonly); - return emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, labelno)); + if (TARGET_FDPIC + && SYMBOL_REF_P (orig) + && !SYMBOL_REF_FUNCTION_P (orig) + && !info_known) + { + /* We don't know where orig is stored, so we have be + pessimistic and use a GOT relocation. */ + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + + insn = calculate_pic_address_constant (reg, pic_reg, orig); + } + else if (TARGET_FDPIC + && SYMBOL_REF_P (orig) + && (SYMBOL_REF_FUNCTION_P (orig) + || !is_readonly)) + { + /* We use the GOTOFF relocation. */ + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + + rtx l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, orig), UNSPEC_PIC_SYM); + emit_insn (gen_movsi (reg, l1)); + insn = emit_insn (gen_addsi3 (reg, reg, pic_reg)); + } + else + { + /* Not FDPIC, not SYMBOL_REF_P or readonly: we can use + PC-relative access. */ + /* We use an UNSPEC rather than a LABEL_REF because this label + never appears in the code stream. */ + labelno = GEN_INT (pic_labelno++); + l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + l1 = gen_rtx_CONST (VOIDmode, l1); + + /* On the ARM the PC register contains 'dot + 8' at the time of the + addition, on the Thumb it is 'dot + 4'. */ + offset_rtx = plus_constant (Pmode, l1, TARGET_ARM ? 8 : 4); + offset_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, orig, offset_rtx), + UNSPEC_SYMBOL_OFFSET); + offset_rtx = gen_rtx_CONST (Pmode, offset_rtx); + + insn = emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, + labelno)); + } + + return insn; } /* Return nonzero if X is valid as an ARM state addressing register. */ @@ -16051,9 +16177,32 @@ get_jump_table_size (rtx_jump_table_data *insn) return 0; } +/* Emit insns to load the function address from FUNCDESC (an FDPIC + function descriptor) into a register and the GOT address into the + FDPIC register, returning an rtx for the register holding the + function address. */ + +rtx +arm_load_function_descriptor (rtx funcdesc) +{ + rtx fnaddr_reg = gen_reg_rtx (Pmode); + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx fnaddr = gen_rtx_MEM (Pmode, funcdesc); + rtx gotaddr = gen_rtx_MEM (Pmode, plus_constant (Pmode, funcdesc, 4)); + + emit_move_insn (fnaddr_reg, fnaddr); + + /* The ABI requires the entry point address to be loaded first, but + since we cannot support lazy binding for lack of atomic load of + two 32-bits values, we do not need to bother to prevent the + previous load from being moved after that of the GOT address. */ + emit_insn (gen_restore_pic_register_after_call (pic_reg, gotaddr)); + + return fnaddr_reg; +} + /* Return the maximum amount of padding that will be inserted before label LABEL. */ - static HOST_WIDE_INT get_label_padding (rtx label) { @@ -18188,6 +18337,12 @@ arm_emit_call_insn (rtx pat, rtx addr, bool sibcall) use_reg (&CALL_INSN_FUNCTION_USAGE (insn), cfun->machine->pic_reg); } + if (TARGET_FDPIC) + { + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), fdpic_reg); + } + if (TARGET_AAPCS_BASED) { /* For AAPCS, IP and CC can be clobbered by veneers inserted by the @@ -23010,10 +23165,36 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) && (!SYMBOL_REF_LOCAL_P (x) || (SYMBOL_REF_DECL (x) ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0)))) - fputs ("(GOT)", asm_out_file); + { + if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) + fputs ("(GOTFUNCDESC)", asm_out_file); + else + fputs ("(GOT)", asm_out_file); + } else - fputs ("(GOTOFF)", asm_out_file); + { + if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) + fputs ("(GOTOFFFUNCDESC)", asm_out_file); + else + { + bool is_readonly; + + if (!TARGET_FDPIC + || arm_is_segment_info_known (x, &is_readonly)) + fputs ("(GOTOFF)", asm_out_file); + else + fputs ("(GOT)", asm_out_file); + } + } } + + /* For FDPIC we also have to mark symbol for .data section. */ + if (TARGET_FDPIC + && !making_const_table + && SYMBOL_REF_P (x) + && SYMBOL_REF_FUNCTION_P (x)) + fputs ("(FUNCDESC)", asm_out_file); + fputc ('\n', asm_out_file); return true; } diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 8b92c83..e404e2c 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -885,6 +885,9 @@ extern int arm_arch_cmse; Pascal), so the following is not true. */ #define STATIC_CHAIN_REGNUM 12 +/* r9 is the FDPIC register (base register for GOT and FUNCDESC accesses). */ +#define FDPIC_REGNUM 9 + /* Define this to be where the real frame pointer is if it is not possible to work out the offset between the frame pointer and the automatic variables until after register allocation has taken place. FRAME_POINTER_REGNUM @@ -1941,6 +1944,10 @@ extern unsigned arm_pic_register; data addresses in memory. */ #define PIC_OFFSET_TABLE_REGNUM arm_pic_register +/* For FDPIC, the FDPIC register is call-clobbered (otherwise PLT + entries would need to handle saving and restoring it). */ +#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED TARGET_FDPIC + /* We can't directly access anything that contains a symbol, nor can we indirect via the constant pool. One exception is UNSPEC_TLS, which is always PIC. */ diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index e236831..027febb 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -7601,6 +7601,11 @@ : !REG_P (callee)) XEXP (operands[0], 0) = force_reg (Pmode, callee); + if (TARGET_FDPIC && !SYMBOL_REF_P (XEXP (operands[0], 0))) + /* Indirect call: set r9 with FDPIC value of callee. */ + XEXP (operands[0], 0) + = arm_load_function_descriptor (XEXP (operands[0], 0)); + if (detect_cmse_nonsecure_call (addr)) { pat = gen_nonsecure_call_internal (operands[0], operands[1], @@ -7612,10 +7617,33 @@ pat = gen_call_internal (operands[0], operands[1], operands[2]); arm_emit_call_insn (pat, XEXP (operands[0], 0), false); } + + /* Restore FDPIC register (r9) after call. */ + if (TARGET_FDPIC) + { + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx initial_fdpic_reg + = get_hard_reg_initial_val (Pmode, FDPIC_REGNUM); + + emit_insn (gen_restore_pic_register_after_call (fdpic_reg, + initial_fdpic_reg)); + } + DONE; }" ) +(define_insn "restore_pic_register_after_call" + [(set (match_operand:SI 0 "s_register_operand" "+r,r") + (unspec:SI [(match_dup 0) + (match_operand:SI 1 "nonimmediate_operand" "r,m")] + UNSPEC_PIC_RESTORE))] + "" + "@ + mov\t%0, %1 + ldr\t%0, %1" +) + (define_expand "call_internal" [(parallel [(call (match_operand 0 "memory_operand") (match_operand 1 "general_operand")) @@ -7689,6 +7717,11 @@ : !REG_P (callee)) XEXP (operands[1], 0) = force_reg (Pmode, callee); + if (TARGET_FDPIC && !SYMBOL_REF_P (XEXP (operands[1], 0))) + /* Indirect call: set r9 with FDPIC value of callee. */ + XEXP (operands[1], 0) + = arm_load_function_descriptor (XEXP (operands[1], 0)); + if (detect_cmse_nonsecure_call (addr)) { pat = gen_nonsecure_call_value_internal (operands[0], operands[1], @@ -7701,6 +7734,18 @@ operands[2], operands[3]); arm_emit_call_insn (pat, XEXP (operands[1], 0), false); } + + /* Restore FDPIC register (r9) after call. */ + if (TARGET_FDPIC) + { + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx initial_fdpic_reg + = get_hard_reg_initial_val (Pmode, FDPIC_REGNUM); + + emit_insn (gen_restore_pic_register_after_call (fdpic_reg, + initial_fdpic_reg)); + } + DONE; }" ) @@ -8043,7 +8088,7 @@ (const_int 0)) (match_operand 1 "" "") (match_operand 2 "" "")])] - "TARGET_EITHER" + "TARGET_EITHER && !TARGET_FDPIC" " { int i; @@ -8110,7 +8155,7 @@ (define_expand "untyped_return" [(match_operand:BLK 0 "memory_operand") (match_operand 1 "" "")] - "TARGET_EITHER" + "TARGET_EITHER && !TARGET_FDPIC" " { int i; diff --git a/gcc/config/arm/unspecs.md b/gcc/config/arm/unspecs.md index 41068ba..a9f99d0 100644 --- a/gcc/config/arm/unspecs.md +++ b/gcc/config/arm/unspecs.md @@ -89,6 +89,7 @@ UNSPEC_SP_SET ; Represent the setting of stack protector's canary UNSPEC_SP_TEST ; Represent the testing of stack protector's canary ; against the guard. + UNSPEC_PIC_RESTORE ; Use to restore fdpic register ]) (define_c_enum "unspec" [ diff --git a/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c b/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c index 4753e36..51a76fc 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c +++ b/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c @@ -17,5 +17,5 @@ F (__fp16 a, __fp16 b, __fp16 c) } /* { dg-final { scan-assembler-times {mov\tr[0-9]+, r[0-2]} 3 } } */ -/* { dg-final { scan-assembler-times {mov\tr1, r0} 1 } } */ +/* { dg-final { scan-assembler-times {mov\tr1, r[03]} 1 } } */ /* { dg-final { scan-assembler-times {mov\tr0, r[0-9]+} 2 } } */ diff --git a/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c b/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c index 41c7ab7..ae65fb8 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c +++ b/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c @@ -16,5 +16,5 @@ F (__fp16 a, __fp16 b, __fp16 c) } /* { dg-final { scan-assembler-times {mov\tr[0-9]+, r[0-2]} 3 } } */ -/* { dg-final { scan-assembler-times {mov\tr1, r0} 1 } } */ +/* { dg-final { scan-assembler-times {mov\tr1, r[03]} 1 } } */ /* { dg-final { scan-assembler-times {mov\tr0, r[0-9]+} 2 } } */ From patchwork Mon Sep 9 15:44:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173394 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4535564ilq; Mon, 9 Sep 2019 08:47:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfIyt9IuoQn6Of84mbY0od1Sv46bJbI08U0oqsvISwsIJnMKA8+6hwNZTHuMmrZrXUnEAx X-Received: by 2002:aa7:ce02:: with SMTP id d2mr24903848edv.270.1568044054544; Mon, 09 Sep 2019 08:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044054; cv=none; d=google.com; s=arc-20160816; b=OkgGl7SB8nbq5fBmAaXLvN/VwxqcrRMDujLOzSq8IroL45c+xijKiXsYHL+NUx2iZ4 eDiInLnbRpl3crzsTd3MMPJD0T9VNyysqhl+MkREgMoV9bSv/nQicGAGTMtzvodBph+/ ehTcB3/7JQBDJwvEld8r3f8W/ZCD5NNCCgJTdtjhgstSqc8ZL+LxhEzzUXDB0WDmQYVm HRNaLRpdzPFkue+COfK6cJrUIYhNI3yyQSdV16HimFjz+Y0s12jqz1v4ZCFHL+2ZxSqE 004EVUoehNeIwCxzbGnTn4ZSZ11XAcY0qvVkf7ADMYW9+0na6dZw8v1MhDWW/ATz0xM+ 6BIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=qzqjIa9m2glbaH0qse0GvzBJVtGVjy+4eBBdCp9fJhA=; b=DNsrWdejOl3rT7mDg/XnydwXzRR2qBI7cPBv5/jz3BgHMygfC53OkSJ0il2gACQ7MW eMPSqH6pYFPJwqon8kLmUPlfRttJ8hvrbbvMr2D+at+XFby1OrhrQgWWdnHDEYN/9c6T ZZ6kDLTH3Pbz30sZiBg9DufITRgliGiP2VXg5ANJDyeFgAP4BS2w96XGdlz26dQoYkl+ ubg4+FpjIlS0WIWjKi3Iamr3bOKnCmCtI9uIn+lX7NsD9c5nC8B4SAUeo6nw9tknCMAC QzfZLfVA3rps6wr3tSVTDm64hywcRLKJr6rbzLab6k8K/J9eV+wczoupNmw7PAmRmHg7 rlZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=FMqqK9Nv; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=GYXZCKYN; spf=pass (google.com: domain of gcc-patches-return-508647-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508647-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id t22si7859937ejx.202.2019.09.09.08.47.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:47:34 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508647-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=FMqqK9Nv; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=GYXZCKYN; spf=pass (google.com: domain of gcc-patches-return-508647-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508647-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=wrY M5V2k3aWVgosERomkaU90UBJsnThx+ppzatyqNhvoP893aPrlhufdMnRDe8qdLUv EBj79i8vu6+rTlsMTyxHJ9Lqi4D4aGjlbwaIrXuJNKxUfTLV2E8PRyyoKGk9GB0e rJKUOLipe/2WaPFqBofLe4Z2mFZ+wEQFcUfjW9Ms= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=pRRi4DY7B mPTz3K6EHOkgfFhz3k=; b=FMqqK9Nvs2L1/6xNCZ2XMFWpAgjzhUaqLjk+m31FB 6uJkaEacJJfY+dX90/FYO6gmVo2+Hhfd8OeNLV3q34x4W4eyYqvPH1cQurLWPZc/ MRK3m3Embs0CtAQQMV2huA6xqOPUQrlUug84Ob+h0v9Gp8pAU++I4lxm4Ap/LcWH wQ= Received: (qmail 116528 invoked by alias); 9 Sep 2019 15:47:21 -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 116514 invoked by uid 89); 9 Sep 2019 15:47:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=__asm__, HContent-Transfer-Encoding:8bit X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:47:20 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkPQO001291 for ; Mon, 9 Sep 2019 17:47:17 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=qzqjIa9m2glbaH0qse0GvzBJVtGVjy+4eBBdCp9fJhA=; b=GYXZCKYNrUp2KDYeEO/RzGna4t09dVBT3Xvms4GXZOSKfVkkzVoN2THTC3x7BMkXUaOV Zxnl0S1emxlXx+WpDGy4F3ge6sVEOD7ckwB3qxGeyu5GNNuAdFXM3b6Og0SM1tRMFDq4 EO2LxLhsUhA8GX40d/mwKaRJ6w+RSmKK3ua8aCKcCet3cepnpvRTXbzD2gE6jCwOv3HB DSdbS7i8ULftWop+8R/rPd/hQ0/nitJ07chUjY5xX4ATdj1K+juaIC/nEX0CZrty37eZ U+IyeA0cifnGytTZVNbpOxiP3LpwyGs0t9l11uus4XxZKnJU4Y5udGJ3ct0cMfh5PmCu AQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212ek6a-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:47:17 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id A7D734B for ; Mon, 9 Sep 2019 15:47:14 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 15E542B9BCC for ; Mon, 9 Sep 2019 17:47:14 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:47:13 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 05/24] [ARM] FDPIC: Fix __do_global_dtors_aux and frame_dummy generation Date: Mon, 9 Sep 2019 17:44:47 +0200 Message-ID: <20190909154526.11630-6-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon In FDPIC, we need to make sure __do_global_dtors_aux and frame_dummy are referenced by their address, not by pointers to the function descriptors. 2019-XX-XX Christophe Lyon Mickaël Guêné libgcc/ * libgcc/crtstuff.c: Add support for FDPIC. Change-Id: I0bc4b1232fbf3c69068fb23a1b9cafc895d141b1 -- 2.6.3 diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c index c8a8e2c..c93e1cb 100644 --- a/libgcc/crtstuff.c +++ b/libgcc/crtstuff.c @@ -429,9 +429,17 @@ __do_global_dtors_aux (void) #ifdef FINI_SECTION_ASM_OP CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux) #elif defined (FINI_ARRAY_SECTION_ASM_OP) +#if defined(__FDPIC__) +__asm__("\t.equ\t__do_global_dtors_aux_alias, __do_global_dtors_aux\n"); +extern char __do_global_dtors_aux_alias; +static void *__do_global_dtors_aux_fini_array_entry[] +__attribute__ ((__used__, section(".fini_array"), aligned(sizeof(void *)))) + = { &__do_global_dtors_aux_alias }; +#else /* defined(__FDPIC__) */ static func_ptr __do_global_dtors_aux_fini_array_entry[] __attribute__ ((__used__, section(".fini_array"), aligned(__alignof__(func_ptr)))) = { __do_global_dtors_aux }; +#endif /* defined(__FDPIC__) */ #else /* !FINI_SECTION_ASM_OP && !FINI_ARRAY_SECTION_ASM_OP */ static void __attribute__((used)) __do_global_dtors_aux_1 (void) @@ -473,9 +481,17 @@ frame_dummy (void) #ifdef __LIBGCC_INIT_SECTION_ASM_OP__ CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_SECTION_ASM_OP__, frame_dummy) #else /* defined(__LIBGCC_INIT_SECTION_ASM_OP__) */ +#if defined(__FDPIC__) +__asm__("\t.equ\t__frame_dummy_alias, frame_dummy\n"); +extern char __frame_dummy_alias; +static void *__frame_dummy_init_array_entry[] +__attribute__ ((__used__, section(".init_array"), aligned(sizeof(void *)))) + = { &__frame_dummy_alias }; +#else /* defined(__FDPIC__) */ static func_ptr __frame_dummy_init_array_entry[] __attribute__ ((__used__, section(".init_array"), aligned(__alignof__(func_ptr)))) = { frame_dummy }; +#endif /* defined(__FDPIC__) */ #endif /* !defined(__LIBGCC_INIT_SECTION_ASM_OP__) */ #endif /* USE_EH_FRAME_REGISTRY || USE_TM_CLONE_REGISTRY */ From patchwork Mon Sep 9 15:44:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173395 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4535952ilq; Mon, 9 Sep 2019 08:47:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyE0Kn+NVQBhntQQRWVrqBIzXfMBQsl+fkuBqQ3/7rsCTDRi/8vrBVP/pwrznSWw9QVTq4E X-Received: by 2002:aa7:da90:: with SMTP id q16mr18213481eds.123.1568044075903; Mon, 09 Sep 2019 08:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044075; cv=none; d=google.com; s=arc-20160816; b=Wj4GEr+Axlj+rjb8L0wA15ledkMWJeOaDdXFeW0/CmGviEKwhIDYejrXGzIvAHSsrn 8HR3yVKrSGkAQv33DkP5t9cJVBrCWHQiPe9Q9e4697cjr3owE6gH1HWp91mjrsuqMQru pS7jrQw92U8RFIEHUco/bEmgtAqnCwpYIhBT1+5DMCYQynb1+TE3T1MmO1OWQ5/JKBe1 vjAkwoQ/E+19Zvomwfk0R0/K0aI4Hoj+ue8nKWWdEMeHq5yk8oIfRsAES5DyzjfO8aA/ h5L05gq8NBxXIE2uGqsmUeYnAnX+T7fNca3WqX1AmvCnnQ30rGKvuESnzddqoJY5gPl6 vipw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=XlTm03Sc8Z4WSnmQ3Ch8vcDaZFHEnjChx0QGLVQokx4=; b=E0B1ddzGd/ij34G2ItsjRPPYV4ynMG7Pceh5cl3Ml9xm9TjnsBHNLwwxdp9xquNqx+ ySptJJVcTSBjnaH9wvXqJtGCcnpgCVxWDnp5JAe7CjArN8wRz1X/TKFvWN86vkU/QlUS dz1TzwfovuIhab7udnus6oNRD1ujS7x22hKZecIOSC1nC6Mtsnb2AU8Ayuy5vUwyK2nG Xti7lJLtD4PJbJGd95lTtw8+C+DFdvnnuu7GOu38fFEeG/FV21qhZBfzZWmribufWVmF IHyQ2uZREVfeXbeUMb5laOlLKktMPk0oOOhX12cndhju6XYN+amCHQXxvyUwZ0H669BW wQ6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=fi+T8emz; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=pEi5YLHw; spf=pass (google.com: domain of gcc-patches-return-508648-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508648-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id t40si9708713edb.391.2019.09.09.08.47.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:47:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508648-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=fi+T8emz; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=pEi5YLHw; spf=pass (google.com: domain of gcc-patches-return-508648-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508648-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=r45 P22qhsQjwZQyuC60yoyXLZicUiZJZbb02tqaj45TKGIFXySiQe/mw+mGtqiDPCAb NZDmAoNAWq+36gqeTm5TO5hWMEVzw3QAXvFf2KXblhkWJbU+ytnHeuUQINjlx4oB V2sR6KR5AgR1oqsTi2AddK3Kh4B6mjd9AUKO2OAA= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=s/AJvEzT3 A42WMEzKMYMIoVvUAo=; b=fi+T8emzmpg4+R+bb4UFUFR7gY+JO7iWHTOJjQ6Qt RQlKOyNTBVMW5SSIFtqM+tu4XtjBVY5EuftIp0tAemMAfYge/6744IS4COgEFLI8 Id6+HizANoFafi4SdQBsuHOqviBvTFxHEeExP+6uKleha22c7seCyPhXMcy+nZ4m yE= Received: (qmail 118143 invoked by alias); 9 Sep 2019 15:47:42 -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 118134 invoked by uid 89); 9 Sep 2019 15:47:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=xstr, Upload X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:47:40 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkPQW001291 for ; Mon, 9 Sep 2019 17:47:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=XlTm03Sc8Z4WSnmQ3Ch8vcDaZFHEnjChx0QGLVQokx4=; b=pEi5YLHwPAteDfxB0IuvaNilV6kvmFpx6QsygaGbsdxfZr4lP8QHpo+3ohXqLxqHevVn fAr6m7Xgr+JVMr3hqK6kgc6d5TVHw4Q7LvacsHoylGM2b/7v7kNRpYgjiDeU8rahAtJC vciOM3pDwBe8bcWzXAavNoG2SMlwlucRp4wMZE0tLh91I6kwY+Yd3F13tCc0QMBRfO9L F33+yK1I8/mTx9lYGyWQuKgr00zRCmv/CS0Ah91jmMbSRJUsl9ijohL8f9xMBuKacpMV 1kRcoReP5G0oBBigCXwpzSAilVUFriqkeKzGo9cGhbfp/GgQJ+D35FX15ZLvOVXB54AC 7A== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212ek8a-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:47:37 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id DBF8324 for ; Mon, 9 Sep 2019 15:47:34 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 4CFA62B9BCE for ; Mon, 9 Sep 2019 17:47:34 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:47:34 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 06/24] [ARM] FDPIC: Add support for c++ exceptions Date: Mon, 9 Sep 2019 17:44:48 +0200 Message-ID: <20190909154526.11630-7-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon The main difference with existing support is that function addresses are function descriptor addresses instead. This means that all code dealing with function pointers now has to cope with function descriptors instead. For the same reason, Linux kernel helpers can no longer be called by dereferencing their address, so we implement wrappers that directly call the kernel helpers. When restoring a function address, we also have to restore the FDPIC register value (r9). 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * ginclude/unwind-arm-common.h (unwinder_cache): Add reserved5 field. libgcc/ * config/arm/linux-atomic.c (__kernel_cmpxchg): Add FDPIC support. (__kernel_dmb): Likewise. (__fdpic_cmpxchg): New function. (__fdpic_dmb): New function. * config/arm/unwind-arm.h (FDPIC_REGNUM): New define. (gnu_Unwind_Find_got): New function. (_Unwind_decode_typeinfo_ptr): Add FDPIC support. * unwind-arm-common.inc (UCB_PR_GOT): New. (funcdesc_t): New struct. (get_eit_entry): Add FDPIC support. (unwind_phase2): Likewise. (unwind_phase2_forced): Likewise. (__gnu_Unwind_RaiseException): Likewise. (__gnu_Unwind_Resume): Likewise. (__gnu_Unwind_Backtrace): Likewise. * unwind-pe.h (read_encoded_value_with_base): Likewise. libstdc++/ * libsupc++/eh_personality.cc (get_ttype_entry): Add FDPIC support. Change-Id: I64b81cfaf390a05f2fd121f44ba1912cb4b47cae -- 2.6.3 diff --git a/gcc/ginclude/unwind-arm-common.h b/gcc/ginclude/unwind-arm-common.h index 6df783e..d4eb03e 100644 --- a/gcc/ginclude/unwind-arm-common.h +++ b/gcc/ginclude/unwind-arm-common.h @@ -91,7 +91,7 @@ extern "C" { _uw reserved2; /* Personality routine address */ _uw reserved3; /* Saved callsite address */ _uw reserved4; /* Forced unwind stop arg */ - _uw reserved5; + _uw reserved5; /* Personality routine GOT value in FDPIC mode. */ } unwinder_cache; /* Propagation barrier cache (valid after phase 1): */ diff --git a/libgcc/config/arm/linux-atomic.c b/libgcc/config/arm/linux-atomic.c index 06a6d46..565f829 100644 --- a/libgcc/config/arm/linux-atomic.c +++ b/libgcc/config/arm/linux-atomic.c @@ -25,11 +25,62 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* Kernel helper for compare-and-exchange. */ typedef int (__kernel_cmpxchg_t) (int oldval, int newval, int *ptr); -#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) 0xffff0fc0) + +#define STR(X) #X +#define XSTR(X) STR(X) + +#define KERNEL_CMPXCHG 0xffff0fc0 + +#if __FDPIC__ +/* Non-FDPIC ABIs call __kernel_cmpxchg directly by dereferencing its + address, but under FDPIC we would generate a broken call + sequence. That's why we have to implement __kernel_cmpxchg and + __kernel_dmb here: this way, the FDPIC call sequence works. */ +#define __kernel_cmpxchg __fdpic_cmpxchg +#else +#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) KERNEL_CMPXCHG) +#endif /* Kernel helper for memory barrier. */ typedef void (__kernel_dmb_t) (void); -#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0) + +#define KERNEL_DMB 0xffff0fa0 + +#if __FDPIC__ +#define __kernel_dmb __fdpic_dmb +#else +#define __kernel_dmb (*(__kernel_dmb_t *) KERNEL_DMB) +#endif + +#if __FDPIC__ +static int __fdpic_cmpxchg (int oldval, int newval, int *ptr) +{ + int result; + + asm volatile ( + "ldr ip, 1f\n\t" + "bx ip\n\t" + "1:\n\t" + ".word " XSTR(KERNEL_CMPXCHG) "\n\t" + : "=r" (result) + : "r" (oldval) , "r" (newval), "r" (ptr) + : "r3", "memory"); + /* The result is actually returned by the kernel helper, we need + this to avoid a warning. */ + return result; +} + +static void __fdpic_dmb (void) +{ + asm volatile ( + "ldr ip, 1f\n\t" + "bx ip\n\t" + "1:\n\t" + ".word " XSTR(KERNEL_DMB) "\n\t" + ); +} + +#endif /* Note: we implement byte, short and int versions of atomic operations using the above kernel helpers; see linux-atomic-64bit.c for "long long" (64-bit) diff --git a/libgcc/config/arm/unwind-arm.h b/libgcc/config/arm/unwind-arm.h index 43c5379..2bf320a 100644 --- a/libgcc/config/arm/unwind-arm.h +++ b/libgcc/config/arm/unwind-arm.h @@ -33,9 +33,33 @@ /* Use IP as a scratch register within the personality routine. */ #define UNWIND_POINTER_REG 12 +#define FDPIC_REGNUM 9 + +#define STR(x) #x +#define XSTR(x) STR(x) + #ifdef __cplusplus extern "C" { #endif +_Unwind_Ptr __attribute__((weak)) __gnu_Unwind_Find_got (_Unwind_Ptr); + +static inline _Unwind_Ptr gnu_Unwind_Find_got (_Unwind_Ptr ptr) +{ + _Unwind_Ptr res; + + if (__gnu_Unwind_Find_got) + res = __gnu_Unwind_Find_got (ptr); + else + { + asm volatile ("mov %[result], r" XSTR(FDPIC_REGNUM) + : [result]"=r" (res) + : + :); + } + + return res; +} + /* Decode an R_ARM_TARGET2 relocation. */ static inline _Unwind_Word _Unwind_decode_typeinfo_ptr (_Unwind_Word base __attribute__ ((unused)), @@ -48,7 +72,12 @@ extern "C" { if (!tmp) return 0; -#if (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__) \ +#if __FDPIC__ + /* For FDPIC, we store the offset of the GOT entry. */ + /* So, first get GOT from dynamic linker and then use indirect access. */ + tmp += gnu_Unwind_Find_got (ptr); + tmp = *(_Unwind_Word *) tmp; +#elif (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__) \ || defined(__FreeBSD__) || defined(__fuchsia__) /* Pc-relative indirect. */ #define _GLIBCXX_OVERRIDE_TTYPE_ENCODING (DW_EH_PE_pcrel | DW_EH_PE_indirect) diff --git a/libgcc/unwind-arm-common.inc b/libgcc/unwind-arm-common.inc index fd572fe..0bacc11 100644 --- a/libgcc/unwind-arm-common.inc +++ b/libgcc/unwind-arm-common.inc @@ -62,6 +62,7 @@ __gnu_Unwind_Find_exidx (_Unwind_Ptr, int *); #define UCB_PR_ADDR(ucbp) ((ucbp)->unwinder_cache.reserved2) #define UCB_SAVED_CALLSITE_ADDR(ucbp) ((ucbp)->unwinder_cache.reserved3) #define UCB_FORCED_STOP_ARG(ucbp) ((ucbp)->unwinder_cache.reserved4) +#define UCB_PR_GOT(ucbp) ((ucbp)->unwinder_cache.reserved5) /* Unwind descriptors. */ @@ -85,6 +86,16 @@ typedef struct __EIT_entry _uw content; } __EIT_entry; +#ifdef __FDPIC__ + +/* Only used in FDPIC case. */ +struct funcdesc_t +{ + unsigned int ptr; + unsigned int got; +}; +#endif + /* Assembly helper functions. */ /* Restore core register state. Never returns. */ @@ -259,7 +270,21 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) { /* One of the predefined standard routines. */ _uw idx = (*(_uw *) ucbp->pr_cache.ehtp >> 24) & 0xf; +#if __FDPIC__ + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) __gnu_unwind_get_pr_addr (idx); + if (funcdesc) + { + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + } + else + UCB_PR_ADDR (ucbp) = 0; + } +#else UCB_PR_ADDR (ucbp) = __gnu_unwind_get_pr_addr (idx); +#endif if (UCB_PR_ADDR (ucbp) == 0) { /* Failed */ @@ -270,6 +295,10 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) { /* Execute region offset to PR */ UCB_PR_ADDR (ucbp) = selfrel_offset31 (ucbp->pr_cache.ehtp); +#if __FDPIC__ + UCB_PR_GOT (ucbp) + = (unsigned int) gnu_Unwind_Find_got ((_Unwind_Ptr) UCB_PR_ADDR (ucbp)); +#endif } return _URC_OK; } @@ -291,14 +320,29 @@ unwind_phase2 (_Unwind_Control_Block * ucbp, phase2_vrs * vrs) UCB_SAVED_CALLSITE_ADDR (ucbp) = VRS_PC(vrs); /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (_US_UNWIND_FRAME_STARTING, ucbp, (_Unwind_Context *) vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_UNWIND_FRAME_STARTING, ucbp, (_Unwind_Context *) vrs); +#endif } while (pr_result == _URC_CONTINUE_UNWIND); if (pr_result != _URC_INSTALL_CONTEXT) abort(); +#if __FDPIC__ + /* r9 could have been lost due to PLT jump. Restore correct value. */ + vrs->core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (vrs)); +#endif + uw_restore_core_regs (vrs, &vrs->core); } @@ -346,8 +390,18 @@ unwind_phase2_forced (_Unwind_Control_Block *ucbp, phase2_vrs *entry_vrs, next_vrs = saved_vrs; /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (action, ucbp, (void *) &next_vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (action, ucbp, (void *) &next_vrs); +#endif saved_vrs.prev_sp = VRS_SP (&next_vrs); } @@ -384,6 +438,11 @@ unwind_phase2_forced (_Unwind_Control_Block *ucbp, phase2_vrs *entry_vrs, return _URC_FAILURE; } +#if __FDPIC__ + /* r9 could have been lost due to PLT jump. Restore correct value. */ + saved_vrs.core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (&saved_vrs)); +#endif + uw_restore_core_regs (&saved_vrs, &saved_vrs.core); } @@ -429,8 +488,18 @@ __gnu_Unwind_RaiseException (_Unwind_Control_Block * ucbp, return _URC_FAILURE; /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (_US_VIRTUAL_UNWIND_FRAME, ucbp, (void *) &saved_vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_VIRTUAL_UNWIND_FRAME, ucbp, (void *) &saved_vrs); +#endif } while (pr_result == _URC_CONTINUE_UNWIND); @@ -488,13 +557,27 @@ __gnu_Unwind_Resume (_Unwind_Control_Block * ucbp, phase2_vrs * entry_vrs) } /* Call the cached PR. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (_US_UNWIND_FRAME_RESUME, ucbp, (_Unwind_Context *) entry_vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_UNWIND_FRAME_RESUME, ucbp, (_Unwind_Context *) entry_vrs); +#endif switch (pr_result) { case _URC_INSTALL_CONTEXT: /* Upload the registers to enter the landing pad. */ +#if __FDPIC__ + /* r9 could have been lost due to PLT jump. Restore correct value. */ + entry_vrs->core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (entry_vrs)); +#endif uw_restore_core_regs (entry_vrs, &entry_vrs->core); case _URC_CONTINUE_UNWIND: @@ -586,9 +669,20 @@ __gnu_Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument, } /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + code = ((personality_routine) &funcdesc) + (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND, + ucbp, (void *) &saved_vrs); + } +#else code = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND, ucbp, (void *) &saved_vrs); +#endif } while (code != _URC_END_OF_STACK && code != _URC_FAILURE); diff --git a/libgcc/unwind-pe.h b/libgcc/unwind-pe.h index 4ed1c66..1c9dae5 100644 --- a/libgcc/unwind-pe.h +++ b/libgcc/unwind-pe.h @@ -262,10 +262,27 @@ read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base, if (result != 0) { +#if __FDPIC__ + /* FDPIC relative addresses imply taking the GOT address + into account. */ + if ((encoding & DW_EH_PE_pcrel) && (encoding & DW_EH_PE_indirect)) + { + result += gnu_Unwind_Find_got ((_Unwind_Ptr) u); + result = *(_Unwind_Internal_Ptr *) result; + } + else + { + result += ((encoding & 0x70) == DW_EH_PE_pcrel + ? (_Unwind_Internal_Ptr) u : base); + if (encoding & DW_EH_PE_indirect) + result = *(_Unwind_Internal_Ptr *) result; + } +#else result += ((encoding & 0x70) == DW_EH_PE_pcrel ? (_Unwind_Internal_Ptr) u : base); if (encoding & DW_EH_PE_indirect) result = *(_Unwind_Internal_Ptr *) result; +#endif } } diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc index 35e4e46..1528ab9 100644 --- a/libstdc++-v3/libsupc++/eh_personality.cc +++ b/libstdc++-v3/libsupc++/eh_personality.cc @@ -93,7 +93,15 @@ get_ttype_entry (lsda_header_info *info, _uleb128_t i) _Unwind_Ptr ptr; i *= size_of_encoded_value (info->ttype_encoding); - read_encoded_value_with_base (info->ttype_encoding, info->ttype_base, + read_encoded_value_with_base ( +#if __FDPIC__ + /* Force these flags to nake sure to + take the GOT into account. */ + (DW_EH_PE_pcrel | DW_EH_PE_indirect), +#else + info->ttype_encoding, +#endif + info->ttype_base, info->TType - i, &ptr); return reinterpret_cast(ptr); From patchwork Mon Sep 9 15:44:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173396 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4536617ilq; Mon, 9 Sep 2019 08:48:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUXFnsX4E9UORX2lD3vFLcEOcf3BMR3144sbJrulU/5OmV1EFPXPXrXYbhJmUVxUQzQSFH X-Received: by 2002:aa7:df1a:: with SMTP id c26mr24768471edy.106.1568044114724; Mon, 09 Sep 2019 08:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044114; cv=none; d=google.com; s=arc-20160816; b=DMLYgpS9gJkYV8wjtYOkOrOkYieQprrNP6CWWPXw89THsq2qqI1ZDYznIv+7C5D99j 9ApoI8RJcNmv19Cex2oJHEFJCL07lC6U/SYqu/lCQiVAyE0HG+A8qoRfhWzl4CWGYtan 9ne+AfH3dutVD+AyxJxMrcpmXXMkjSW7iY731CsbRqeHHu1WlcTfcaEIk+MQ/eJjAbB1 fsZeui8ZdZOeQ9yss3kxwzeHTBLdswfqi+lr1kEEmBHIMLOhpx+F+/0fSGHCy+0pyMmk YSyuJYvjO8EO4j6aKjbIk40PUqGfgqEw58nMyXpToFPlcpFbPzm0QXeMLzA1ww9H4Vzp Wt/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=SxKKe98Y2GYALZtAEgj0v4RtmnDno7TAQiGjNsJrIOo=; b=mq6Bh1AdseqVryGnjpangp6gRZbFl2BWu8t1extHRSppucvAQ5fT9jkfU2Aa85Fu2x ZAQOl7X95dy2FXBLnaH/fN5gT+em1hVzd1vjm/qm9P2b2HXKwGxOJAL7t/b/CRKxcERW tj3PycVZRnIAJ8MYyhZshq0Q2iJdojE8Y0wUxb3SloouJ02YWIlcF+sFWDw3OEOU4SLs JhdQ2tNILXd23j0NvLgsM+RoFnC4n/79qQiydgReNFoEeX4ya5dZt/sRU3rg6kQw9O0f ri6mdj9ttHl+SvmvUb6jtq2UHR8ZFArrQrFcYvrjWgtL9PpKURGZSnUPxVcKTAo+JUg4 JYkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=CxEkP2J2; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="D/5z/hju"; spf=pass (google.com: domain of gcc-patches-return-508649-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508649-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g13si7413706ejp.264.2019.09.09.08.48.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:48:34 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508649-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=CxEkP2J2; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="D/5z/hju"; spf=pass (google.com: domain of gcc-patches-return-508649-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508649-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=fDL hyPNcRGYAe7jMnhciCI6BfuiG4InVhESY1koUIFMXad5f0hVwgeRV/1qrDnp7uFe Xz3m014FmHWFMBi4dPMUvpi6BPFUray/pkamB24pasILYxqJMOh3Pr7hi4W2sEtP 8jkpoe5wcnUq/omklN9tgRgIadSsJSxGGtB0Ls7w= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=IKx+bANwj /12HV9mnDLvqrlqj7s=; b=CxEkP2J2WFBuiwwaNfFE++/6HIxqYNlzkuMurD1Sz 6IbWNhyYMw1gr/6escPd0MLNtJ2XH7RISsweUecjHuaK4iPIRaZKYGlDGB+YKVzX XDo9XdzUsjDSq1qbihItuv90NvufmiWj4GfbLdrMrOnfjF1I8Z1+dRBPL1Gk+aMs Gs= Received: (qmail 119753 invoked by alias); 9 Sep 2019 15:48:05 -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 119735 invoked by uid 89); 9 Sep 2019 15:48:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:48:02 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkGL6003551 for ; Mon, 9 Sep 2019 17:48:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=SxKKe98Y2GYALZtAEgj0v4RtmnDno7TAQiGjNsJrIOo=; b=D/5z/hjuAwxE7x3hG1BQ87hzomQCLTVFcygSlbHTf9mMUc2sLLUV6oWesOEZrL7jSdId Z4BOhxfofLR5UcXwXZVCk+NgZCEgmjjibLyA/59JDIRL7gsXP8wHb/X9QTrdr9kwpibu ebNXBfALWin1UZM9UxaUidaVw1+o7I5GYvrN6tVke2WUg+Vrz7U7wAlOxQ5/gEtmXFLU kWedNopaYxs0kjdKUJ0EXFMUiSxsyP8VtHMg+3FDhHmKAnE++2FMkOZWCIbizWJDHb8m UbYsGpAJp7lyCbFmq+vUEe2jr8/dVEWTdeT3IASGq5a1E9wXLkcyzVyssO1kbv2WY75k AQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa70mm-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:48:00 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 4854A24 for ; Mon, 9 Sep 2019 15:47:57 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 73FEA2B9BE2 for ; Mon, 9 Sep 2019 17:47:54 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:47:54 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 07/24] [ARM] FDPIC: Avoid saving/restoring r9 on stack since it is read-only Date: Mon, 9 Sep 2019 17:44:49 +0200 Message-ID: <20190909154526.11630-8-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.h (PIC_REGISTER_MAY_NEED_SAVING): New helper. * config/arm/arm.c (arm_compute_save_reg0_reg12_mask): Handle FDPIC. Change-Id: I0f3b2023ab2a2a0433dfe081dac6bbb194b7a76c -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index c34aab8..6ff3001 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -19571,9 +19571,7 @@ arm_compute_save_reg0_reg12_mask (void) save_reg_mask |= (1 << reg); /* Also save the pic base register if necessary. */ - if (flag_pic - && !TARGET_SINGLE_PIC_BASE - && arm_pic_register != INVALID_REGNUM + if (PIC_REGISTER_MAY_NEED_SAVING && crtl->uses_pic_offset_table) save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; } @@ -19605,9 +19603,7 @@ arm_compute_save_reg0_reg12_mask (void) /* If we aren't loading the PIC register, don't stack it even though it may be live. */ - if (flag_pic - && !TARGET_SINGLE_PIC_BASE - && arm_pic_register != INVALID_REGNUM + if (PIC_REGISTER_MAY_NEED_SAVING && (df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM) || crtl->uses_pic_offset_table)) save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index e404e2c..490d22d 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1960,6 +1960,13 @@ extern unsigned arm_pic_register; || label_mentioned_p (get_pool_constant (X))))) \ || tls_mentioned_p (X)) +/* We may want to save the PIC register if it is a dedicated one. */ +#define PIC_REGISTER_MAY_NEED_SAVING \ + (flag_pic \ + && !TARGET_SINGLE_PIC_BASE \ + && !TARGET_FDPIC \ + && arm_pic_register != INVALID_REGNUM) + /* We need to know when we are making a constant pool; this determines whether data needs to be in the GOT or can be referenced via a GOT offset. */ From patchwork Mon Sep 9 15:44:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173397 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4536851ilq; Mon, 9 Sep 2019 08:48:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOIp7huV9IGPUeZmGD0fdrStTtECQ3KXMEfzLtjyqyxta8YsqcSmV6/nAJc7ZLmYEJ8Idy X-Received: by 2002:aa7:d8cf:: with SMTP id k15mr25498943eds.195.1568044126497; Mon, 09 Sep 2019 08:48:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044126; cv=none; d=google.com; s=arc-20160816; b=urSMUPPnV+OljggoYTgqlkaMmOLiBuSRK5qcVDAefevyiRsjr9dBLTDtCIeiOucHQ8 Eer3Ykv9JChkNO5lRv4RKmJBeg9k/Srw7q1e+9UVBxEMMYnP4tWd9mUtCmOFRoZ9TZgZ Tgpfj6rn4BM82E/T8ybc+Qr+iBtdT/Xgq7jAYdSNugbZkJqvyni2UjZeTS4ZCxxfRfnp yxgFryuiQ7e0ninEGoYAXy1NGjLVmoZTG1KJTROBPNWLp5EvrSLtbpdwFAVsLfBZ8IuH lfNSejmzYbZwEItOeRjlZvuN5NZ45BuhtxRt5MtnLhRezHIl9wKNqk4CetsUGJHemoyl +wiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=CBXsndEM3gHUvnQ3DAtdTvD0g56U0EIb/mapmsA6e4M=; b=mqavzo9hSAwYOXZnv3IgUytqZysGuCYyjUyoE4/PAfCvaoqnE6O70iHsH/fa1csoYf 0pCM7yAzhLjBJzNta3rI9wQHZP9o8hKSLBnNTVZPGRKQCg+qEKK4Xnf4mfP+d8jjJ4Ak 66eOyI1wDmFLnP+3wuP7ZQ3ZREWRYg+SC5v6RwiCLnVFUWAdrb8Y1AOTMQQ+kppYLrf/ HnKeAiYcA9fVBO7Jg37FwS3dEfzHxd2lfLxH+a5rxhLoT2tJIoOnuqVfZ9tVDubhDCFD /ymaLIqm0jij4l1zecRpzCO2d7i++3tJ5BaPedJMtC6vAPViuIJFxolakFE75Bzl/pCu uROg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=GL24NDKz; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=T7jTqlMv; spf=pass (google.com: domain of gcc-patches-return-508650-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508650-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y5si7740713ejq.201.2019.09.09.08.48.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:48:46 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508650-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=GL24NDKz; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=T7jTqlMv; spf=pass (google.com: domain of gcc-patches-return-508650-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508650-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=WJ+ VqWRWZuWOOyWljOsff2RoAKdmDni8urPQaJ4GvUjHPnaO+zuz+I9B7i91ybKIXsS l+xyZfm1g/8/lRf8KPZ2SM7IiWYki6/6b2rZ7M6XhyiPYHe2GQA7RWwK5bOt9y5/ ANiM8j92udMfXMKaw7+BoHBFaLg1PzReF1s4e4RI= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=CDsp7RsbC JhWTDXLCheX7UZz+P0=; b=GL24NDKzOwJN12c4tDh7yZkOi/kTKXbsKEMxK+ct/ eLRW2yBAPJmS2LN5vdehllZz0LCWz2tgk54SqD8JWdjQhkDS9GCiajpYAh8wtTcF Z5fKgWmwqI9MKsi45WuEfG5NLLxYVoIMeGt30ObaU0868qk8zW9/FSQL4bIgI2IV aU= Received: (qmail 120060 invoked by alias); 9 Sep 2019 15:48:22 -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 119926 invoked by uid 89); 9 Sep 2019 15:48:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:48:20 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkgaZ027615 for ; Mon, 9 Sep 2019 17:48:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=CBXsndEM3gHUvnQ3DAtdTvD0g56U0EIb/mapmsA6e4M=; b=T7jTqlMvpmGbdHG2Y1TUQcHJqgun5bXd89u5eDPMgPZtZS/mNk3EhMis5n33vAbMput2 k5Zwdx/cXvQUCLliY0FY4lRo3hmROsHJ1VT8LEpyl3+Qt93mrNt3sAJvLap+CU1FfjQ4 OgnE35afOhdBgNxbvCzn+0PhoNGgxJlQeea+kDQKxJWStn31RU0qxRd4xsYxrYqLkNVP k4Kf1YE+78HJ7jSy9hHdbl4d8WcLL+xomE1gkH1SULJwVuCZd8r/TOaW2k982QHtBsIv l/28unVhSaOsvnEvgvTqQRRAE5sfhE2KN0EZCsNt2Thh/de8NIrXHIN4+ki2SNWMOC9K gA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv3ehpjqb-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:48:18 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 3F6A123 for ; Mon, 9 Sep 2019 15:48:15 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A576C2B9BEE for ; Mon, 9 Sep 2019 17:48:14 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:48:14 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 08/24] [ARM] FDPIC: Enforce local/global binding for function descriptors Date: Mon, 9 Sep 2019 17:44:50 +0200 Message-ID: <20190909154526.11630-9-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Use local binding rules to decide whether we can use GOTOFFFUNCDESC to compute the function address. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (arm_fdpic_local_funcdesc_p): New function. (legitimize_pic_address): Enforce binding rules on function pointers in FDPIC mode. (arm_assemble_integer): Likewise. Change-Id: I3fa0b63bc0f672903f405aa72cc46052de1c0feb -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 6ff3001..6b0c95f 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3754,6 +3754,42 @@ arm_options_perform_arch_sanity_checks (void) } } +/* Test whether a local function descriptor is canonical, i.e., + whether we can use GOTOFFFUNCDESC to compute the address of the + function. */ +static bool +arm_fdpic_local_funcdesc_p (rtx fnx) +{ + tree fn; + enum symbol_visibility vis; + bool ret; + + if (!TARGET_FDPIC) + return true; + + if (! SYMBOL_REF_LOCAL_P (fnx)) + return false; + + fn = SYMBOL_REF_DECL (fnx); + + if (! fn) + return false; + + vis = DECL_VISIBILITY (fn); + + if (vis == VISIBILITY_PROTECTED) + /* Private function descriptors for protected functions are not + canonical. Temporarily change the visibility to global so that + we can ensure uniqueness of funcdesc pointers. */ + DECL_VISIBILITY (fn) = VISIBILITY_DEFAULT; + + ret = default_binds_local_p_1 (fn, flag_pic); + + DECL_VISIBILITY (fn) = vis; + + return ret; +} + static void arm_add_gc_roots (void) { @@ -7534,7 +7570,9 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg, rtx pic_reg, || (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig) && (SYMBOL_REF_DECL (orig) - ? !DECL_WEAK (SYMBOL_REF_DECL (orig)) : 1))) + ? !DECL_WEAK (SYMBOL_REF_DECL (orig)) : 1) + && (!SYMBOL_REF_FUNCTION_P (orig) + || arm_fdpic_local_funcdesc_p (orig)))) && NEED_GOT_RELOC && arm_pic_data_is_text_relative) insn = arm_pic_static_addr (orig, reg); @@ -23160,7 +23198,9 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) || (GET_CODE (x) == SYMBOL_REF && (!SYMBOL_REF_LOCAL_P (x) || (SYMBOL_REF_DECL (x) - ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0)))) + ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0) + || (SYMBOL_REF_FUNCTION_P (x) + && !arm_fdpic_local_funcdesc_p (x))))) { if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) fputs ("(GOTFUNCDESC)", asm_out_file); From patchwork Mon Sep 9 15:44:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173398 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4537160ilq; Mon, 9 Sep 2019 08:49:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKLp5BX9A9eSG0qI0/03Ufek8aQPOViWf2FCQCxYx6NtmF2+ICdV3sEq3Fyre+eVYBUNX5 X-Received: by 2002:a17:906:1a12:: with SMTP id i18mr15047122ejf.19.1568044142984; Mon, 09 Sep 2019 08:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044142; cv=none; d=google.com; s=arc-20160816; b=v8a9iZdkMB/mS00arIl9M6TbwalQiBT9I9HSHevBP2S/uRomsJ3/xpVgxTc4pZqEGH e+4+vk2FC6bZKt4NF6MblTs+YHgZhom4/nO6jXOdySk0G9jZkbpWDeKK4usfTA3w0YbJ GJvH+qUuvz4PcCJv/ydlvJpNEooTZyXn4bXuWfGcxGayvkepM7KVNzPb6TXP4YjoZReI 6ZlDcGcXq9CxSbhZwSrsvH6OsCA2F1SrxctIuU8qDV5v0WxpqwKUY4fUvAkNuT0Eptjk fqpNhDNHhV4cUWgGK4QfARjYHhah1j/gyYvz4JMjayctcK/ymffojXxA4Btl97GRWzaZ I5YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=qSwSlsC1jddyg4w+tj74Rsaa3g06R/660Q/W3hv4LFI=; b=QXrIv10F3FSLCk+MoNGQyosT3i3k6cBrKJAGHvPGoRiN1N010X8oyf5ZtXTTtetw3Z 4LSm2k6p4dnqfcaA9wXftC/K9KDN8BX/URebvoBg/cb0h60UyVDrZy1LHaYjKQK4jou7 0gX10mOtWwbfoPJl/7+JZSLhfJT2nvx6vD6irzgHA4J9pCwioLM7sFwfdhv7AW+Jurp1 aKg7MSbvjIVk9r5OI0XtxlSTP5JuNCEZQTm9SKj4HkdsLbV5Q20MMmbW9vYvawyuPte6 Bnup8Hn0lnmnMbGdKc3M78EW/S7gAWJg2LaNgZZPol9plQisqb5ySa716+U4nyfPtSd2 PS7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=wTG9CkwI; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="esY/0CaO"; spf=pass (google.com: domain of gcc-patches-return-508651-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508651-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id x17si5632381ejf.230.2019.09.09.08.49.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:49:02 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508651-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=wTG9CkwI; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="esY/0CaO"; spf=pass (google.com: domain of gcc-patches-return-508651-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508651-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=HTS L5M2/FwQrDORiN78RwV5+3xDC4ILrxnn69xKYtTRDQFVvGokUWF2GsqCEzcbjddd WCzfIcSiJaSDb2dHG+i4xabFFjtAc6gqi10xXmAzE3iF73pGt4bX7X2RJ3Xt/iyy IwP2wyYg9bn/BVwSugjDjk0M4OFPpJ1g/54f1Xac= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=WJaEkxmiU Xfc8idxEO+icy8m/9A=; b=wTG9CkwIe2MfgPZ65GDj37IVDsLgXtScb4pBScqxF H4eSTZTf6wFXFy/bsTLhXN8zhRuuhyAVotXjY6+BMHkFPf5sP9JjHs8Qm7sO39Qr UTupqZU+GUo9t62yxMDkMpToA+3+jCEOPMxKw6xl4N1uIiQ308W19H8zgEU4F7lF sA= Received: (qmail 122907 invoked by alias); 9 Sep 2019 15:48:50 -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 122899 invoked by uid 89); 9 Sep 2019 15:48:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Arm, block_op_normal, emit_block_move, BLOCK_OP_NORMAL X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:48:48 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkhFe027618 for ; Mon, 9 Sep 2019 17:48:46 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=qSwSlsC1jddyg4w+tj74Rsaa3g06R/660Q/W3hv4LFI=; b=esY/0CaOU9C1p2tIyUct+SoSZf/9K510Yg+kYXM6P4PNYcXm28k9RSIiGVqNL8HP0ME9 KfwfPSxbujUXjQEVCwM8O/Z335krwLAYwJypY9bgOyZGncCsAc/KYnJ6wMnZ7iOhNK1X PwU1PgzkO9l+Vk9uo4Ba7PJ0TYiHlsT2kmzQi6wHoZFpFsokC3peBTjQp7KRbHYt033H l5Pt/STFCIT7BFqfEGzHppDZYmZ/NuN4Eoy6URmkHNsoN5TL3MuVXobqq/a3gObzEjGu /1HWaIn4meVrsGN8ruddQMjwTFWiFpeKfd34TinxY9rWVKITkcbkdKXVIB1iZBEvdXLr /Q== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv3ehpjsh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:48:46 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 9769D23 for ; Mon, 9 Sep 2019 15:48:35 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id DA3FE2ADEEE for ; Mon, 9 Sep 2019 17:48:34 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:48:34 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 09/24] [ARM] FDPIC: Add support for taking address of nested function Date: Mon, 9 Sep 2019 17:44:51 +0200 Message-ID: <20190909154526.11630-10-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon In FDPIC mode, the trampoline generated to support pointers to nested functions looks like: .word trampoline address .word trampoline GOT address ldr r12, [pc, #8] ldr r9, [pc, #8] ldr pc, [pc, #8] .word static chain value .word GOT address .word function's address because in FDPIC function pointers are actually pointers to function descriptors, we have to actually generate a function descriptor for the trampoline. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (arm_asm_trampoline_template): Add FDPIC support. (arm_trampoline_init): Likewise. (arm_trampoline_adjust_address): Likewise. * config/arm/arm.h (TRAMPOLINE_SIZE): Likewise. Change-Id: Idc4d5f629ae4f8d79bdf9623517481d524a0c144 -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 6b0c95f..d01fae3 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3939,14 +3939,52 @@ arm_warn_func_return (tree decl) ldr pc, [pc] .word static chain value .word function's address - XXX FIXME: When the trampoline returns, r8 will be clobbered. */ + XXX FIXME: When the trampoline returns, r8 will be clobbered. + + In FDPIC mode, the trampoline looks like: + .word trampoline address + .word trampoline GOT address + ldr r12, [pc, #8] ; #4 for Arm mode + ldr r9, [pc, #8] ; #4 for Arm mode + ldr pc, [pc, #8] ; #4 for Arm mode + .word static chain value + .word GOT address + .word function's address +*/ static void arm_asm_trampoline_template (FILE *f) { fprintf (f, "\t.syntax unified\n"); - if (TARGET_ARM) + if (TARGET_FDPIC) + { + /* The first two words are a function descriptor pointing to the + trampoline code just below. */ + if (TARGET_ARM) + fprintf (f, "\t.arm\n"); + else if (TARGET_THUMB2) + fprintf (f, "\t.thumb\n"); + else + /* Only ARM and Thumb-2 are supported. */ + gcc_unreachable (); + + assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); + assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); + /* Trampoline code which sets the static chain register but also + PIC register before jumping into real code. */ + asm_fprintf (f, "\tldr\t%r, [%r, #%d]\n", + STATIC_CHAIN_REGNUM, PC_REGNUM, + TARGET_THUMB2 ? 8 : 4); + asm_fprintf (f, "\tldr\t%r, [%r, #%d]\n", + PIC_OFFSET_TABLE_REGNUM, PC_REGNUM, + TARGET_THUMB2 ? 8 : 4); + asm_fprintf (f, "\tldr\t%r, [%r, #%d]\n", + PC_REGNUM, PC_REGNUM, + TARGET_THUMB2 ? 8 : 4); + assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); + } + else if (TARGET_ARM) { fprintf (f, "\t.arm\n"); asm_fprintf (f, "\tldr\t%r, [%r, #0]\n", STATIC_CHAIN_REGNUM, PC_REGNUM); @@ -3987,12 +4025,40 @@ arm_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) emit_block_move (m_tramp, assemble_trampoline_template (), GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL); - mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 8 : 12); - emit_move_insn (mem, chain_value); + if (TARGET_FDPIC) + { + rtx funcdesc = XEXP (DECL_RTL (fndecl), 0); + rtx fnaddr = gen_rtx_MEM (Pmode, funcdesc); + rtx gotaddr = gen_rtx_MEM (Pmode, plus_constant (Pmode, funcdesc, 4)); + /* The function start address is at offset 8, but in Thumb mode + we want bit 0 set to 1 to indicate Thumb-ness, hence 9 + below. */ + rtx trampoline_code_start + = plus_constant (Pmode, XEXP (m_tramp, 0), TARGET_THUMB2 ? 9 : 8); + + /* Write initial funcdesc which points to the trampoline. */ + mem = adjust_address (m_tramp, SImode, 0); + emit_move_insn (mem, trampoline_code_start); + mem = adjust_address (m_tramp, SImode, 4); + emit_move_insn (mem, gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM)); + /* Setup static chain. */ + mem = adjust_address (m_tramp, SImode, 20); + emit_move_insn (mem, chain_value); + /* GOT + real function entry point. */ + mem = adjust_address (m_tramp, SImode, 24); + emit_move_insn (mem, gotaddr); + mem = adjust_address (m_tramp, SImode, 28); + emit_move_insn (mem, fnaddr); + } + else + { + mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 8 : 12); + emit_move_insn (mem, chain_value); - mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 12 : 16); - fnaddr = XEXP (DECL_RTL (fndecl), 0); - emit_move_insn (mem, fnaddr); + mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 12 : 16); + fnaddr = XEXP (DECL_RTL (fndecl), 0); + emit_move_insn (mem, fnaddr); + } a_tramp = XEXP (m_tramp, 0); emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), @@ -4006,7 +4072,9 @@ arm_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) static rtx arm_trampoline_adjust_address (rtx addr) { - if (TARGET_THUMB) + /* For FDPIC don't fix trampoline address since it's a function + descriptor and not a function address. */ + if (TARGET_THUMB && !TARGET_FDPIC) addr = expand_simple_binop (Pmode, IOR, addr, const1_rtx, NULL, 0, OPTAB_LIB_WIDEN); return addr; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 490d22d..8b67c9c 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1595,7 +1595,7 @@ typedef struct #define INIT_EXPANDERS arm_init_expanders () /* Length in units of the trampoline for entering a nested function. */ -#define TRAMPOLINE_SIZE (TARGET_32BIT ? 16 : 20) +#define TRAMPOLINE_SIZE (TARGET_FDPIC ? 32 : (TARGET_32BIT ? 16 : 20)) /* Alignment required for a trampoline in bits. */ #define TRAMPOLINE_ALIGNMENT 32 From patchwork Mon Sep 9 15:44:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173399 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4537463ilq; Mon, 9 Sep 2019 08:49:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwver/aSJYxT7zkCrpJpghblDATw7a+TUUzfpU5KvRBpO2QM5izV42Fzkx20WIHngsoeUf X-Received: by 2002:aa7:c995:: with SMTP id c21mr20035037edt.129.1568044156905; Mon, 09 Sep 2019 08:49:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044156; cv=none; d=google.com; s=arc-20160816; b=v4Bk7b79jCjLBBlpVHSElzv6Ff18TwOxvumOk6jWWc845ygV5ge5tBk9e984wQrcjv AGno1eeoj1sQv8TrmbT5FAyZmCF9eiKxSlVI9nsQw+8LFe8l8SJiZS3s0QfwfDdrc3AC bhzxdDs8wEtgcxioWQrM00BJMFB3pW/MEcbypPbmNlLIEM9KDr7cvjouKZpHY1eY4P58 9FDkuQ76A/K09SbCrtHrRdWTU7zk6hbAVgrDIv6Qjrlih96QjK9dkPXHH9ITQZ300moa I9KtJx9RO76vJwiLf3I2Xw8oMy+zZYpBfyZdR8v4SXAku3U0LSflDFjwHwcN6dHrGpmA oUjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=A7EMVHVTS6bPrQssozG6OlLSlmc8mcwhOV1nfWF1Y/g=; b=nT49GJRaXxXv6j6yviqTWRLTUFGXO/zuwugXxbjJuJ++ptDHfgZDCm3e1aeoUJal1q uZtqqrJHsfWgLK6ffB/wT04R2beRgA/V3SvjYiJutTTBTtgrqMI42mBvqRfuVldeMmq2 nvoEKRyhmHAoVGj1O5s7I1a8u7D+mJjVSsvIw6AFUjHlncLPaqIWvPkE1yNQE5kpdAXz /pdFvOZNHjvkVqrUP9cQjqKqve3ceVQIO9A01oELn2G4klkD4xvhf1ti8IhYezWVn/ly 8Xj/rxhu9EDsRrQFQne9mzRIF/uvLW605ItwvnALUvJ00dyeWQACOwHf6L89ZUQWa86F RBhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=DFYcYFaZ; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=zN79hHbz; spf=pass (google.com: domain of gcc-patches-return-508652-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508652-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w20si4709025edq.264.2019.09.09.08.49.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:49:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508652-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=DFYcYFaZ; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=zN79hHbz; spf=pass (google.com: domain of gcc-patches-return-508652-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508652-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=VHp NoBo1V2OzeUOu5AgrPaYF94tdFHhV6Sa6x6J1Ysr47BKRPV0OcQYyTrdloehEEDF 1FKVJYwryguNt23EU8ZYq23/qwQiSFXoG0yA3EjVZbTCO+MDYPNRdWp7hNDv5RrM OK1a9TDMk5rB6BstyB7Ijew/Jl+J8luAUBm1xLHI= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=cZz02wVX6 vtlbAJ9fzFexcwN2gI=; b=DFYcYFaZwa/3gIVHh7kEGwtRpgYfInIVG3VZS45Th vg6j/8NRP7Fl8rBjZ30E9vzIjFD1/kSfkDusMjSfIkrMgZ1rTkUCX6duIGrHsW1Y UjELdIFsQ5ntHuRcG8dpoAOf+2YSILwZLJAab8Yu0tgcyxvtB61pzDRJy3OS0bWc 4g= Received: (qmail 124334 invoked by alias); 9 Sep 2019 15:49:03 -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 124326 invoked by uid 89); 9 Sep 2019 15:49:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:49:00 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89Fkj7a027635 for ; Mon, 9 Sep 2019 17:48:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=A7EMVHVTS6bPrQssozG6OlLSlmc8mcwhOV1nfWF1Y/g=; b=zN79hHbzWZ/0V4Sln89GedikvCPpvFBRb7tcmXR2LZKpihC+7P4ONkPGbSYdtBVzJYe7 2gU7OcRDrrJqyq1hP9mnI9Oy+G1JTXA4HrW2PnruTBfL/ONQnCWYrQ6Q06P6Nb3EvRjz +7d9o0xTH7TdvrBQUHFfo7JH208/+57TwVfwoixHy1+w9jd2P0o6r5A4X3xkkFnMk6it HK5o/j58lvmQh6GpuDXkXIP9Cf5ipKzOe6F6LQkGPDBO5CT0MqpOGM3depBMcx02HaC1 CZ/h92O2T6/IOMJSqeNsWhvyXPzu0wOm2naw+Uz7HoNyLqs94yjfXLi5jqJifHYJa7F5 wA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv3ehpjtu-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:48:58 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id ADE364C for ; Mon, 9 Sep 2019 15:48:55 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 1939A2B9BFA for ; Mon, 9 Sep 2019 17:48:55 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:48:54 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 10/24] [ARM] FDPIC: Implement TLS support. Date: Mon, 9 Sep 2019 17:44:52 +0200 Message-ID: <20190909154526.11630-11-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Support additional relocations: TLS_GD32_FDPIC, TLS_LDM32_FDPIC, and TLS_IE32_FDPIC. We do not support the GNU2 TLS dialect. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (tls_reloc): Add TLS_GD32_FDPIC, TLS_LDM32_FDPIC and TLS_IE32_FDPIC. (arm_call_tls_get_addr): Add FDPIC support. (legitimize_tls_address): Likewise. (arm_emit_tls_decoration): Likewise. Change-Id: I4ea5034ff654540c4658d0a79fb92f70550cdf4a -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index d01fae3..5f1d2d4 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -2350,9 +2350,12 @@ char arm_arch_name[] = "__ARM_ARCH_PROFILE__"; enum tls_reloc { TLS_GD32, + TLS_GD32_FDPIC, TLS_LDM32, + TLS_LDM32_FDPIC, TLS_LDO32, TLS_IE32, + TLS_IE32_FDPIC, TLS_LE32, TLS_DESCSEQ /* GNU scheme */ }; @@ -8708,22 +8711,33 @@ load_tls_operand (rtx x, rtx reg) static rtx_insn * arm_call_tls_get_addr (rtx x, rtx reg, rtx *valuep, int reloc) { - rtx label, labelno, sum; + rtx label, labelno = NULL_RTX, sum; gcc_assert (reloc != TLS_DESCSEQ); start_sequence (); - labelno = GEN_INT (pic_labelno++); - label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); - label = gen_rtx_CONST (VOIDmode, label); + if (TARGET_FDPIC) + { + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (reloc)), + UNSPEC_TLS); + } + else + { + labelno = GEN_INT (pic_labelno++); + label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + label = gen_rtx_CONST (VOIDmode, label); - sum = gen_rtx_UNSPEC (Pmode, - gen_rtvec (4, x, GEN_INT (reloc), label, - GEN_INT (TARGET_ARM ? 8 : 4)), - UNSPEC_TLS); + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (4, x, GEN_INT (reloc), label, + GEN_INT (TARGET_ARM ? 8 : 4)), + UNSPEC_TLS); + } reg = load_tls_operand (sum, reg); - if (TARGET_ARM) + if (TARGET_FDPIC) + emit_insn (gen_addsi3 (reg, reg, gen_rtx_REG (Pmode, FDPIC_REGNUM))); + else if (TARGET_ARM) emit_insn (gen_pic_add_dot_plus_eight (reg, reg, labelno)); else emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); @@ -8761,6 +8775,7 @@ arm_tls_descseq_addr (rtx x, rtx reg) return reg; } + rtx legitimize_tls_address (rtx x, rtx reg) { @@ -8773,6 +8788,8 @@ legitimize_tls_address (rtx x, rtx reg) case TLS_MODEL_GLOBAL_DYNAMIC: if (TARGET_GNU2_TLS) { + gcc_assert (!TARGET_FDPIC); + reg = arm_tls_descseq_addr (x, reg); tp = arm_load_tp (NULL_RTX); @@ -8782,7 +8799,10 @@ legitimize_tls_address (rtx x, rtx reg) else { /* Original scheme */ - insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32); + if (TARGET_FDPIC) + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32_FDPIC); + else + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32); dest = gen_reg_rtx (Pmode); emit_libcall_block (insns, dest, ret, x); } @@ -8791,6 +8811,8 @@ legitimize_tls_address (rtx x, rtx reg) case TLS_MODEL_LOCAL_DYNAMIC: if (TARGET_GNU2_TLS) { + gcc_assert (!TARGET_FDPIC); + reg = arm_tls_descseq_addr (x, reg); tp = arm_load_tp (NULL_RTX); @@ -8799,7 +8821,10 @@ legitimize_tls_address (rtx x, rtx reg) } else { - insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32); + if (TARGET_FDPIC) + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32_FDPIC); + else + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32); /* Attach a unique REG_EQUIV, to allow the RTL optimizers to share the LDM result with other LD model accesses. */ @@ -8818,23 +8843,35 @@ legitimize_tls_address (rtx x, rtx reg) return dest; case TLS_MODEL_INITIAL_EXEC: - labelno = GEN_INT (pic_labelno++); - label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); - label = gen_rtx_CONST (VOIDmode, label); - sum = gen_rtx_UNSPEC (Pmode, - gen_rtvec (4, x, GEN_INT (TLS_IE32), label, - GEN_INT (TARGET_ARM ? 8 : 4)), - UNSPEC_TLS); - reg = load_tls_operand (sum, reg); - - if (TARGET_ARM) - emit_insn (gen_tls_load_dot_plus_eight (reg, reg, labelno)); - else if (TARGET_THUMB2) - emit_insn (gen_tls_load_dot_plus_four (reg, NULL, reg, labelno)); + if (TARGET_FDPIC) + { + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (TLS_IE32_FDPIC)), + UNSPEC_TLS); + reg = load_tls_operand (sum, reg); + emit_insn (gen_addsi3 (reg, reg, gen_rtx_REG (Pmode, FDPIC_REGNUM))); + emit_move_insn (reg, gen_rtx_MEM (Pmode, reg)); + } else { - emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); - emit_move_insn (reg, gen_const_mem (SImode, reg)); + labelno = GEN_INT (pic_labelno++); + label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + label = gen_rtx_CONST (VOIDmode, label); + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (4, x, GEN_INT (TLS_IE32), label, + GEN_INT (TARGET_ARM ? 8 : 4)), + UNSPEC_TLS); + reg = load_tls_operand (sum, reg); + + if (TARGET_ARM) + emit_insn (gen_tls_load_dot_plus_eight (reg, reg, labelno)); + else if (TARGET_THUMB2) + emit_insn (gen_tls_load_dot_plus_four (reg, NULL, reg, labelno)); + else + { + emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); + emit_move_insn (reg, gen_const_mem (SImode, reg)); + } } tp = arm_load_tp (NULL_RTX); @@ -28158,15 +28195,24 @@ arm_emit_tls_decoration (FILE *fp, rtx x) case TLS_GD32: fputs ("(tlsgd)", fp); break; + case TLS_GD32_FDPIC: + fputs ("(tlsgd_fdpic)", fp); + break; case TLS_LDM32: fputs ("(tlsldm)", fp); break; + case TLS_LDM32_FDPIC: + fputs ("(tlsldm_fdpic)", fp); + break; case TLS_LDO32: fputs ("(tlsldo)", fp); break; case TLS_IE32: fputs ("(gottpoff)", fp); break; + case TLS_IE32_FDPIC: + fputs ("(gottpoff_fdpic)", fp); + break; case TLS_LE32: fputs ("(tpoff)", fp); break; From patchwork Mon Sep 9 15:44:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173400 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4537829ilq; Mon, 9 Sep 2019 08:49:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBzWt+D/gxjBdXFJgQMmCwyTn1PKuVnKOOEyV5rqBC/9ph8SEMZEgHUVLpkoV6R60fEq83 X-Received: by 2002:a17:906:4e44:: with SMTP id g4mr19994558ejw.90.1568044176262; Mon, 09 Sep 2019 08:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044176; cv=none; d=google.com; s=arc-20160816; b=Np/XaKe8S09CcR6SSZyVeTjB6I+9KBSvoUeeJ10TR7Zn0qRiVpaycugwuLntggBKT4 S2AFCsJG/D+wDhUQxvqU/esL629FqXhWcqTjEQsRCbAWu7kPABD9Fw1zgBta3T1vqkDd sJbSpJmLCNZwoOgx78s7Zl1BQC7itVcE66yNPtf4+1VJ/YXMepw3nJVYt30gR21z+k0z kdQPovdCU1odUFTceeg0DxKofnGveW0HjiWqevldn/bZzL58utBIHCzzcN709wXJSAN8 UMd1A6yf0ROgYnzVz8GOUvCZUagdwgkoM60xj1sULVZEdigVJnwImd/U/qx9j2InaoDU da2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=M8viSaljgtCHVByPY0WiITc4Xf+vuqFXi7mQ+OLT1aE=; b=umqOoHQh6Xs/gI2Rlm0xEg3REw2EfaGjtLaZCeEsY8tFCUKBkSo2UYlJU5lf2yMv2X pCviLRwXAL6OujBp0+jvGgZF8xkC3ZrAWH0I9ENPqWkZuK8NEkvUKACwuQGqDg6k5Ri+ WXo+m7pCWMpS27BAtv5QdDWMcQ556W6e668khCW4I4RfJDUN4sWXj3lQd0dX2oG7kZdq k4tdA+uH6ovJm1y8aLXTcY0IM/iAhSy+folKIGdIVPncVAdIC4ZdjBuju/yeZ2iXqYeS Ns79d6/vabmwR/k1bMFJOF3U10tb7qSH3yJ7ZzaRH+0MDbohoVNN/JhAH/VTo73LzGNp SAhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=wtwRmdjc; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=kugZev0r; spf=pass (google.com: domain of gcc-patches-return-508653-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508653-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id pv27si7475147ejb.102.2019.09.09.08.49.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:49:36 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508653-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=wtwRmdjc; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=kugZev0r; spf=pass (google.com: domain of gcc-patches-return-508653-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508653-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=TkF JyS+URc3V2C5oYyT3I0jEBkAUPKP9E5fOoepv61FDMVL+8veoGtorfo/a62JKzbO HzchaRyDksQbKgHFdVXhSpcnZSuNyW0TKgJBgqt+myDJHLqZdwJ/eCxoTNkY0fXf 4gTpWNJ8xyoyqU00CUmeiF58Q0PTQrPYF/jVXghY= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=TrpIQZavf 2ocQhqk5whiT2GuDrI=; b=wtwRmdjcKl3JCPywSAV0bC8YMAzDvSSf0yqs8g3Lb yGurWTaDuF5pGRwUm54mB8gytuDLMGhAwmH/ri4OmxNRb1otB1FD7ju0DIhZds1r YByfzh3koFsb/aCgcffXJrUvekSs4DF8qHin9tjDUb4LDFNHGX+zPhggv5jqWRX5 qs= Received: (qmail 125808 invoked by alias); 9 Sep 2019 15:49:22 -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 125800 invoked by uid 89); 9 Sep 2019 15:49:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Signal X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:49:21 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkMUK001843 for ; Mon, 9 Sep 2019 17:49:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=M8viSaljgtCHVByPY0WiITc4Xf+vuqFXi7mQ+OLT1aE=; b=kugZev0ra8SsvtkVHF0vTvhjzZ7SzYSVht5NPu4x/2M3Sl3FiRU7KcdVrgZX7KzKcSyy GGoyYMuviEOeo249rq68b+CC9bfIpMJdbuVQsmLTeuHFYYKA3eZLRRW9AsF0MmyInvtw j8i5yXmGNozZ6orY95vGnLSuDnp3uSHdTxp8k9Z7ByXKyB2Oq4yIiKo83EFlJckZwZ+8 iftqW53lPHBqCvDVs6ZSHzIXq6y/WtMCVLq2aU86FJy8QRlUi6A7/SEa1VFTEZ4/Jg4q G1ZSEl96zSu4MYRskjgLtOArmcLKBSyLVHhncfK5eM2NJL6iDN5geofd6ckqZPQjjwwL AA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv2avxhf1-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:49:18 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id D2D2B22 for ; Mon, 9 Sep 2019 15:49:15 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 43DBB2ADF1E for ; Mon, 9 Sep 2019 17:49:15 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:49:15 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 11/24] [ARM] FDPIC: Add support to unwind FDPIC signal frame Date: Mon, 9 Sep 2019 17:44:53 +0200 Message-ID: <20190909154526.11630-12-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon 2019-XX-XX Christophe Lyon Mickaël Guêné libgcc/ * unwind-arm-common.inc (ARM_SET_R7_RT_SIGRETURN) (THUMB2_SET_R7_RT_SIGRETURN, FDPIC_LDR_R12_WITH_FUNCDESC) (FDPIC_LDR_R9_WITH_GOT, FDPIC_LDR_PC_WITH_RESTORER) (FDPIC_FUNCDESC_OFFSET, ARM_NEW_RT_SIGFRAME_UCONTEXT) (ARM_UCONTEXT_SIGCONTEXT, ARM_SIGCONTEXT_R0, FDPIC_T2_LDR_R12_WITH_FUNCDESC) (FDPIC_T2_LDR_R9_WITH_GOT, FDPIC_T2_LDR_PC_WITH_RESTORER): New. (__gnu_personality_sigframe_fdpic): New. (get_eit_entry): Add FDPIC signal frame support. Change-Id: I7f9527cc50665dd1a731b7badf71c319fb38bf57 -- 2.6.3 diff --git a/libgcc/unwind-arm-common.inc b/libgcc/unwind-arm-common.inc index 0bacc11..c9a82b7 100644 --- a/libgcc/unwind-arm-common.inc +++ b/libgcc/unwind-arm-common.inc @@ -30,6 +30,26 @@ #include #endif +#if __FDPIC__ +/* Load r7 with rt_sigreturn value. */ +#define ARM_SET_R7_RT_SIGRETURN 0xe3a070ad /* mov r7, #0xad */ +#define THUMB2_SET_R7_RT_SIGRETURN 0x07adf04f /* mov.w r7, #0xad */ + +/* FDPIC jump to restorer sequence. */ +#define FDPIC_LDR_R12_WITH_FUNCDESC 0xe59fc004 /* ldr r12, [pc, #4] */ +#define FDPIC_LDR_R9_WITH_GOT 0xe59c9004 /* ldr r9, [r12, #4] */ +#define FDPIC_LDR_PC_WITH_RESTORER 0xe59cf000 /* ldr pc, [r12] */ +#define FDPIC_T2_LDR_R12_WITH_FUNCDESC 0xc008f8df /* ldr.w r12, [pc, #8] */ +#define FDPIC_T2_LDR_R9_WITH_GOT 0x9004f8dc /* ldr.w r9, [r12, #4] */ +#define FDPIC_T2_LDR_PC_WITH_RESTORER 0xf000f8dc /* ldr.w pc, [r12] */ +#define FDPIC_FUNCDESC_OFFSET 12 + +/* Signal frame offsets. */ +#define ARM_NEW_RT_SIGFRAME_UCONTEXT 0x80 +#define ARM_UCONTEXT_SIGCONTEXT 0x14 +#define ARM_SIGCONTEXT_R0 0xc +#endif + /* We add a prototype for abort here to avoid creating a dependency on target headers. */ extern void abort (void); @@ -199,6 +219,45 @@ search_EIT_table (const __EIT_entry * table, int nrec, _uw return_address) } } +#if __FDPIC__ +/* VFP is not restored, but this is sufficient to allow unwinding. */ +static _Unwind_Reason_Code +__gnu_personality_sigframe_fdpic (_Unwind_State state, + _Unwind_Control_Block *ucbp, + _Unwind_Context *context) +{ + unsigned int sp; + unsigned int pc; + unsigned int funcdesc; + unsigned int handler; + unsigned int first_handler_instruction; + int i; + + _Unwind_VRS_Get (context, _UVRSC_CORE, R_SP, _UVRSD_UINT32, &sp); + _Unwind_VRS_Get (context, _UVRSC_CORE, R_PC, _UVRSD_UINT32, &pc); + + funcdesc = *(unsigned int *)((pc & ~1) + FDPIC_FUNCDESC_OFFSET); + handler = *(unsigned int *)(funcdesc); + first_handler_instruction = *(unsigned int *)(handler & ~1); + + /* Adjust SP to point to the start of registers according to + signal type. */ + if (first_handler_instruction == ARM_SET_R7_RT_SIGRETURN + || first_handler_instruction == THUMB2_SET_R7_RT_SIGRETURN) + sp += ARM_NEW_RT_SIGFRAME_UCONTEXT + + ARM_UCONTEXT_SIGCONTEXT + + ARM_SIGCONTEXT_R0; + else + sp += ARM_UCONTEXT_SIGCONTEXT + + ARM_SIGCONTEXT_R0; + /* Restore regs saved on stack by the kernel. */ + for (i = 0; i < 16; i++) + _Unwind_VRS_Set (context, _UVRSC_CORE, i, _UVRSD_UINT32, sp + 4 * i); + + return _URC_CONTINUE_UNWIND; +} +#endif + /* Find the exception index table eintry for the given address. Fill in the relevant fields of the UCB. Returns _URC_FAILURE if an error occurred, _URC_OK on success. */ @@ -222,6 +281,27 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) &nrec); if (!eitp) { +#if __FDPIC__ + /* If we are unwinding a signal handler then perhaps we have + reached a trampoline. Try to detect jump to restorer + sequence. */ + _uw *pc = (_uw *)((return_address+2) & ~1); + if ((pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + || (pc[0] == FDPIC_T2_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_T2_LDR_R9_WITH_GOT + && pc[2] == FDPIC_T2_LDR_PC_WITH_RESTORER)) + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; + + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + + return _URC_OK; + } +#endif UCB_PR_ADDR (ucbp) = 0; return _URC_FAILURE; } @@ -236,6 +316,27 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) if (!eitp) { +#if __FDPIC__ + /* If we are unwinding a signal handler then perhaps we have + reached a trampoline. Try to detect jump to restorer + sequence. */ + _uw *pc = (_uw *)((return_address+2) & ~1); + if ((pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + || (pc[0] == FDPIC_T2_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_T2_LDR_R9_WITH_GOT + && pc[2] == FDPIC_T2_LDR_PC_WITH_RESTORER)) + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; + + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + + return _URC_OK; + } +#endif UCB_PR_ADDR (ucbp) = 0; return _URC_FAILURE; } @@ -244,6 +345,27 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) /* Can this frame be unwound at all? */ if (eitp->content == EXIDX_CANTUNWIND) { +#if __FDPIC__ + /* If we are unwinding a signal handler then perhaps we have + reached a trampoline. Try to detect jump to restorer + sequence. */ + _uw *pc = (_uw *)((return_address+2) & ~1); + if ((pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + || (pc[0] == FDPIC_T2_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_T2_LDR_R9_WITH_GOT + && pc[2] == FDPIC_T2_LDR_PC_WITH_RESTORER)) + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; + + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + + return _URC_OK; + } +#endif UCB_PR_ADDR (ucbp) = 0; return _URC_END_OF_STACK; } From patchwork Mon Sep 9 15:44:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173401 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4538167ilq; Mon, 9 Sep 2019 08:49:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4u9t0Rvx2OwCuDF1adTsFcBESoSCfDe5XewEk+a54PyNd/vqtzMW2AVTIbxl4EfeA6wiJ X-Received: by 2002:a50:c209:: with SMTP id n9mr25301872edf.215.1568044194960; Mon, 09 Sep 2019 08:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044194; cv=none; d=google.com; s=arc-20160816; b=fBqI/6yVYIgPVa5hFgDdEvSecrY1p/2nLq3lsX+BAhUGLcSRVyYmuQ4kwqgqMWt6hE foytjCv14wfoVCsHojKDkcFOloj2LpBm/M0xU+05BUA2FIHSLZcW1qWrMJEqREUBP/F0 NEaCTSPmZuflyt9SRMVMeAeI+ByTrcFdIVcXwmCufnXpDtFZVGzGsOFjdd8jK/YwnHSv OUoLkBz5DsaUKhzdH4QsXnI4MxnGyhZdJD1pmrPHhv9c4FPxtpf2ZFZtCKZKUzdbnjEc 8e0iEGR2Cu2azhQTMj79aex32BmR5L0vkVHPGIxiIcOODyOn1J1Kq2ZoEA3crnRCOkmn +ayA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=UjTVxNi35+SWpXUmMrOWcjwiZYhMTbLA3TwIKHC/6qA=; b=RqDegymUWz5abZXHO8LdlMpedxfXIM6+eHjURaRis07BdO7j1WiyO8m1+CSWq5uiH+ 9LcIcbiruQJryDol6ACFDKZCvKk+HtJ+1oOalExoNkPMoF8xhC2CNr9zuLLTchLo6Ro+ ejpTNDpxIvSUS+FxFCMBSkAmkA4o4WzztUVHhXPjibxvXbXD0F9Wv+b2Nt6G/wNgqXbc toOhz7Ekgy5PK2VPO9nmTCFLottEaz7ahJCWIvzUDEESN3YNgzt5t+0fp6/aq4RXgHuq UZN2XRsPNOnBujNn7A1/fWjYModYfAhIfF4opBBr/S5cGPVIRW4BVdiOtzewgXV+YlQY 7iow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Ir1+ycEV; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=MxYTLxmi; spf=pass (google.com: domain of gcc-patches-return-508654-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508654-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u19si7658607ejt.159.2019.09.09.08.49.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:49:54 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508654-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Ir1+ycEV; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=MxYTLxmi; spf=pass (google.com: domain of gcc-patches-return-508654-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508654-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=l2L 9JerJauk010m7+iHaVddYITN67DmgVFU2UTdIaa2JF3P7KxJmjlbp9cFs3I6UaJH dRjG/naLWuzkdZlGkh8CwaPwdjTpNl0no4ESVQ9hx6iga0c3Whdr1fav2Coq+uIS eNySHGUCl79jmvrQTbe/tkOqvkeFONFq0U4+yEPw= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=O8JmIjq5n AuKVD+Yww7uzwmAT38=; b=Ir1+ycEVcMqeuS3mraeHD12AVYA1x2Qpwo8o9ln9q 5HYdXPJ5VAENClxMjVI3OcSdaptlHILnpOobR9QwEUmEDGJNstCMh711mzkJS+Jn mVkjqXYdNUTUnnTYAh6RYx0m3orCd3dRZr97DVa69IO7tGT/wGpSD02qcG8TgSqQ 9Q= Received: (qmail 127336 invoked by alias); 9 Sep 2019 15:49:43 -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 127328 invoked by uid 89); 9 Sep 2019 15:49:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:49:41 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkKNK001257 for ; Mon, 9 Sep 2019 17:49:39 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=UjTVxNi35+SWpXUmMrOWcjwiZYhMTbLA3TwIKHC/6qA=; b=MxYTLxmiDbxmNeLYfqIHSnC/PD6ahrXZPvxvJJygMnV69VmLopFfSj1p1S0hxgP2iNIZ SezYRlLfXRVtF2qAh2ZpLSudBW2rYZxulnGRbaAwlnTsIELpmHDI7w0L16TCutHACZsx S/lO5EygXLnMIcRohwo7rBV3PG97sM2e32FLC4HO2Xo6AMdgtKCoXJC1+tRPsHxVcQGi CJp2c44+S3Wk+5mxv0LOdHHVvrVhL4DB/4d0DAInLy4mvbrxh/QIRkeGtZuufGI9UQSJ U8fPrEAnC11GT/f7AS7XqrHG6TrZT0b6qBqNoeP5mIQntlQcTOGR+6pIK0Du9y4ItHPH Lg== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212ekj9-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:49:39 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 0B28B23 for ; Mon, 9 Sep 2019 15:49:36 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 6C5AE2B25FB for ; Mon, 9 Sep 2019 17:49:35 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:49:35 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 12/24] [ARM] FDPIC: Restore r9 after we call __aeabi_read_tp Date: Mon, 9 Sep 2019 17:44:54 +0200 Message-ID: <20190909154526.11630-13-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon We call __aeabi_read_tp() to get the thread pointer. Since this is a function call, we have to restore the FDPIC register afterwards. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (arm_load_tp): Add FDPIC support. * config/arm/arm.md (FDPIC_REGNUM): New constant. (load_tp_soft_fdpic): New pattern. (load_tp_soft): Disable in FDPIC mode. Change-Id: I0811cc7c5df8f44dd8b8b1f4caf54c7d3609c414 -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 5f1d2d4..c452771 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -8685,7 +8685,18 @@ arm_load_tp (rtx target) rtx tmp; - emit_insn (gen_load_tp_soft ()); + if (TARGET_FDPIC) + { + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx initial_fdpic_reg = get_hard_reg_initial_val (Pmode, FDPIC_REGNUM); + + emit_insn (gen_load_tp_soft_fdpic ()); + + /* Restore r9. */ + emit_insn (gen_restore_pic_register_after_call(fdpic_reg, initial_fdpic_reg)); + } + else + emit_insn (gen_load_tp_soft ()); tmp = gen_rtx_REG (SImode, R0_REGNUM); emit_move_insn (target, tmp); diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 027febb..918271d 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -31,6 +31,7 @@ [(R0_REGNUM 0) ; First CORE register (R1_REGNUM 1) ; Second CORE register (R4_REGNUM 4) ; Fifth CORE register + (FDPIC_REGNUM 9) ; FDPIC register (IP_REGNUM 12) ; Scratch register (SP_REGNUM 13) ; Stack pointer (LR_REGNUM 14) ; Return address register @@ -11165,12 +11166,25 @@ ) ;; Doesn't clobber R1-R3. Must use r0 for the first operand. +(define_insn "load_tp_soft_fdpic" + [(set (reg:SI 0) (unspec:SI [(const_int 0)] UNSPEC_TLS)) + (clobber (reg:SI FDPIC_REGNUM)) + (clobber (reg:SI LR_REGNUM)) + (clobber (reg:SI IP_REGNUM)) + (clobber (reg:CC CC_REGNUM))] + "TARGET_SOFT_TP && TARGET_FDPIC" + "bl\\t__aeabi_read_tp\\t@ load_tp_soft" + [(set_attr "conds" "clob") + (set_attr "type" "branch")] +) + +;; Doesn't clobber R1-R3. Must use r0 for the first operand. (define_insn "load_tp_soft" [(set (reg:SI 0) (unspec:SI [(const_int 0)] UNSPEC_TLS)) (clobber (reg:SI LR_REGNUM)) (clobber (reg:SI IP_REGNUM)) (clobber (reg:CC CC_REGNUM))] - "TARGET_SOFT_TP" + "TARGET_SOFT_TP && !TARGET_FDPIC" "bl\\t__aeabi_read_tp\\t@ load_tp_soft" [(set_attr "conds" "clob") (set_attr "type" "branch")] From patchwork Mon Sep 9 15:44:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173402 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4538614ilq; Mon, 9 Sep 2019 08:50:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzy4YWACQ5qMUFw5W9m2hCcLe6KCFEsuOYR/AkUqNqezUkifI8B36itGcdzjMo4rjKU1Kgb X-Received: by 2002:a50:fd96:: with SMTP id o22mr20958110edt.218.1568044216635; Mon, 09 Sep 2019 08:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044216; cv=none; d=google.com; s=arc-20160816; b=IbwQfnJvBEV3UNYpN+CfJPHbPYRocBqt4tPq5Y7LPFZAJOKLlDyI5P3iL8Hl0uz3d1 5NuKqZJypb5U6rKMOpt6zm61I3jOGqKRiI0b1E8UaY3dE/2Zew0kCa5zwmcg/WcoS9xt FriQH6PyhkpYuDZw8LWRx5bZXA2llmhyGJxZ6Twa/v/Ju8RZrzfAOToILwxLwPV9r+OE gj2uN/8yYsp669h/zobYriXpVDQVEvEbkGJ9DMA8ReP257IJhZcerCTUrA5UceI6L4z9 NR+zp969aC4XH+/eo+IuN88eGzxDDZFrhirLMoJqFnBH6FasHQcGiT6b2+gFqImjs1Tf Jt5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=1aQ9HGDT+5uBJnceRF5Eaa0gSSJ4x1oK08RWqcj5YXE=; b=YaD1Jpz/dj6ZGtpsCaHw5lY/NkBu/454FStoKMTQHaX/P/z0N373AABnH+nnKB0Au6 eAe3EqZ8bBRyUm8GmtdsmGQBKD9MiMVqBuypgyagpG2ZoqjZV0TVVutpDp1O8aSrsZth u2xCs7sYa7FLugoLiUkvs71JXnc6CtxGUza5ELYx4PFFzNp3U3Nta5lEdkSrggSYxyKq Jr077M4CD23po20JGxliiwhGksuuNtXCaR6byzQf8qoh1FXkj4xuuuBzkuSlCD7zqBcS ZsizDNupB0cSgloxXvOlq+S9RZLDZbNFsoZH9rQHu48r1eVYPIYDH4Mu5V/BdQJPzX2i IWZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=FsImWl4Y; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="1Q0Mr5a/"; spf=pass (google.com: domain of gcc-patches-return-508655-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508655-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z21si8962132edc.4.2019.09.09.08.50.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:50:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508655-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=FsImWl4Y; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="1Q0Mr5a/"; spf=pass (google.com: domain of gcc-patches-return-508655-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508655-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=Iof xuGpBnqbWmmC/a47cPn95sQZXIO3U3SsHcdqecs8aaYc32sesYn5Rj2PFssXxp4C JQMSv5pGw9SssbZoKdQpOEpSHfeGtHs3NyMcEjATULoEBTQKuhH/txbdmXlpuoLO qXNMP93rWplumJ4ewk+AX0+c5S/Ri2IR5ZmeUJBk= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=dXIgCF8Jw yRGzkTKFQ5RWMUX0ck=; b=FsImWl4YNpfEnlYOOiEUHdJHDFz1y2jNxBOoxUOx+ aCKGUuYi/ycKyizwEUdLCV1er3XVyJ09g2rH2BRrupYAdLMvKzMoFwII8cIEYcUr kpz/xyHoKcnN4WG6rAyll8yyL/dZ2iiHzTrMtp7+kQUyun+ZrdsAVhpkqBseGBEq aA= Received: (qmail 128886 invoked by alias); 9 Sep 2019 15:50: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 128878 invoked by uid 89); 9 Sep 2019 15:50:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:50:03 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkORN001286 for ; Mon, 9 Sep 2019 17:50:01 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=1aQ9HGDT+5uBJnceRF5Eaa0gSSJ4x1oK08RWqcj5YXE=; b=1Q0Mr5a/mD9dSUNo/heQgKH6RysztXDbjpLZvmNkgGBHpwPqfu+lN9+NnOrWtPvm+9XX D82wfkUnZ+kV3pNG5y68RYVQIXlc4P1MbmlWtPR/sSsPEz9LonHUz00I0a8Lt93DPaLW yWMUN4MLl/yMxe3GMhSrxLnF8JmhU5tPqiP1Ps4U3nirmdX2xjtqJgG3iEvWdPHNbWg5 MHVl5BcUkgJBbW9++PFzCQCpyueJQovAe6ov6cvWzT+tkAigSZkSNMPs/qn/l/cl/fI9 60GwlxgaGZbFtJRZSSrtvDnIDb9evVB1OuuGLngjH34IsutmkPqzlnbmtrI/gKueJ0qf Ww== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212ekn9-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:50:01 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 397F24B for ; Mon, 9 Sep 2019 15:49:56 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 9941A2B9BFC for ; Mon, 9 Sep 2019 17:49:55 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:49:55 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 13/24] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture Date: Mon, 9 Sep 2019 17:44:55 +0200 Message-ID: <20190909154526.11630-14-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Without this, when we are unwinding across a signal frame we can jump to an even address which leads to an exception. This is needed in __gnu_persnality_sigframe_fdpic() when restoring the PC from the signal frame since the PC saved by the kernel has the LSB bit set to zero. 2019-XX-XX Christophe Lyon Mickaël Guêné libgcc/ * config/arm/unwind-arm.c (_Unwind_VRS_Set): Handle thumb-only architecture. Change-Id: Ie84de548226bcf1751e19a09e8f091fb3013ccea -- 2.6.3 diff --git a/libgcc/config/arm/unwind-arm.c b/libgcc/config/arm/unwind-arm.c index 9ba73e7..8313ee0 100644 --- a/libgcc/config/arm/unwind-arm.c +++ b/libgcc/config/arm/unwind-arm.c @@ -199,6 +199,11 @@ _Unwind_VRS_Result _Unwind_VRS_Set (_Unwind_Context *context, return _UVRSR_FAILED; vrs->core.r[regno] = *(_uw *) valuep; +#if defined(__thumb__) + /* Force LSB bit since we always run thumb code. */ + if (regno == R_PC) + vrs->core.r[regno] |= 1; +#endif return _UVRSR_OK; case _UVRSC_VFP: From patchwork Mon Sep 9 15:44:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173403 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4539004ilq; Mon, 9 Sep 2019 08:50:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7momXV58LVY/+oQR95njnpvRrRByB6BowsSz0pQBBl6zuZp+jLIhq/dGAVKr2yiqGYcy4 X-Received: by 2002:a05:6402:2028:: with SMTP id ay8mr13699430edb.120.1568044238241; Mon, 09 Sep 2019 08:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044238; cv=none; d=google.com; s=arc-20160816; b=HA+vbOb1z0Iz5CvtKgzxXeUQFTkFFU0P0/pHbgQqOgyqSD1qEltixUjZlmqNTALEiN +eZeiakJ4SSP+/uBnhHh5622VWBpDkzW+6mAl7vG7F8v8P+cXye6BGaLiY1NP5jztB2g gS8GeQ49kXmJ5SlETJaUOett+GwYtRcJXi6NSRtkMPqg14GEvwEKsCjP18PWKduIEPu2 SMFy+iDw/uwtLCs26I1vSwDgMjRnOZ/Y52n/aYnFbsKYjUyJ8FsaUX/XEyQlhBSkqp76 /VR1oKUUM9pjBV49jwkpp0C0f1DhAj8KBrcd3u0I3xk9Iz6Z8eF/c3A10emKvWQrgUt6 0Jgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=7GwpjKxZv00igImv92Kgj+zStkhT3TdjMEvURQD16pc=; b=pe3a+QeynccMJstZKclrngQJbWH/UEnnnw94Anysu6Y9voTcNHKrM2lbKRqyl/wKyS B0tgnQA43EovLxc2/4nAUSnabgAAsxtw4ctcOC5sfeV+epqmgofJ2m1d1FC8cfGntB4P WVV9alnT5Hz8ggq9x6S0mVfxloZyb/akGLWgx0jBr9knadlO6MkpIllPkc/ekWd9GlUK BcBC4RTRqfzVBuAvv4DcL1fQA5wrWwuDIo2GFmg8rZ5DUQl669UoX/+Kz4A+UKAaKtGM xe+3IamXOio/7ZE3aQu5w9XajtLvyPLapnLKCGYmkJdazeRJqneDIYmuZ4rPeQ/SJ5q8 hxRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=F8B7RomM; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=j7kGJeIt; spf=pass (google.com: domain of gcc-patches-return-508656-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508656-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id i8si9134553ede.332.2019.09.09.08.50.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:50:38 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508656-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=F8B7RomM; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=j7kGJeIt; spf=pass (google.com: domain of gcc-patches-return-508656-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508656-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=Iw6 hCH+QU14sCoymEKzsyOKqyVgp6hGQhoOOrrqFgr3XakuqTn1Rn6DOOVx91SWgWMs xZ9uTOeGXWn2L7WaK8e9hbfUtwuOBg14MR+CiRvolNk4SHoHLGmr5lm7RzT8o28V gSg8SbrD9IuXC49zq1r+5cWQvuQEoVspiHpM3iEs= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=5WqTsisyT lRuMm0Y5YKg/mLKuHo=; b=F8B7RomM6QF+ZZ5M/AebBF/LsTxp0slz4zRr96kKd 1/eg58mw4sGkenWHZMZ52v0ttfqRe7oHj120E46sk4eeXFvGzLgEb+HIHa6F8qt9 gxvq23wAGhVN9uZuIwTLzeWGGlQW4wag56h5ER7c8RQlo/h9oSah7Yj/nzSAUMvW 7g= Received: (qmail 684 invoked by alias); 9 Sep 2019 15:50:25 -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 675 invoked by uid 89); 9 Sep 2019 15:50:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:50:22 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkKNW001257 for ; Mon, 9 Sep 2019 17:50:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=7GwpjKxZv00igImv92Kgj+zStkhT3TdjMEvURQD16pc=; b=j7kGJeItZ5lXUs++r8GjVOFHaf5j5hsDW1Z5hb7fsp/qCUCKsiUsvrLxWrM/xHY5jq5g dzqdyTxMGu5XNe03gY75ngZw3pMQnMFT4zMLOGKC+NToe9jx5BVZr5VYnVbAk2hBX7X0 MC1uIPqP9L4EMM5RbDCCACSPowu5ENWvERld+/h8/ldo32C1DlY8yosnVOXKlKCsuCb8 DAA1KSC54VOVFkuczeMc9+ED116PWjTKTj4Sqs65/5EI59ARUnkjUE+sQtAFhM650rmq vBTBjg7D/HGnGIe4+aGW65p96k8E9lw/jIE2jfqTp1Pa0jD4p9IKVrFxntJFkNcv26rw 2w== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212ekps-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:50:19 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 2209F22 for ; Mon, 9 Sep 2019 15:50:16 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id D66B92B5A07 for ; Mon, 9 Sep 2019 17:50:15 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:50:15 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 14/24] [ARM][testsuite] FDPIC: Skip unsupported tests Date: Mon, 9 Sep 2019 17:44:56 +0200 Message-ID: <20190909154526.11630-15-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Several tests cannot work on ARM-FDPIC for various reasons: skip them, or skip some directives. gcc.dg/20020312-2.c: Skip since it forces -fno-pic. gcc.target/arm/: * Skip since r9 is clobbered by assembly code: 20051215-1.c mmx-1.c pr61948.c pr77933-1.c pr77933-2.c * Skip since the test forces armv5te which is not supported by FDPIC: pr40887.c pr19599.c * Skip since FDPIC disables sibcall to external functions: sibcall-1.c tail-long-call vfp-longcall-apcs * Skip size check since it's different for FDPIC: ivopts-2.c ivopts-3.c ivopts-4.c ivopts-5.c pr43597.c pr43920-2.c * Disable assembler scanning invalid for FDPIC: pr45701-1.c pr45701-2.c stack-red-zone.c * gnu2 TLS dialect is not supported by FDPIC: tlscall.c * Test relies on symbols not generated in FDPIC: data-rel-2.c data-rel-3.c 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/testsuite/ * gcc.dg/20020312-2.c: Skip on arm*-*-uclinuxfdpiceabi. * gcc.target/arm/20051215-1.c: Likewise. * gcc.target/arm/mmx-1.c: Likewise. * gcc.target/arm/pr19599.c: Likewise. * gcc.target/arm/pr40887.c: Likewise. * gcc.target/arm/pr61948.c: Likewise. * gcc.target/arm/pr77933-1.c: Likewise. * gcc.target/arm/pr77933-2.c: Likewise. * gcc.target/arm/sibcall-1.c: Likewise. * gcc.target/arm/data-rel-2.c: Likewise. * gcc.target/arm/data-rel-3.c: Likewise. * gcc.target/arm/tail-long-call: Likewise. * gcc.target/arm/tlscall.c: Likewise. * gcc.target/arm/vfp-longcall-apcs: Likewise. * gcc.target/arm/ivopts-2.c: Skip object-size test on arm*-*-uclinuxfdpiceabi. * gcc.target/arm/ivopts-3.c: Likewise. * gcc.target/arm/ivopts-4.c: Likewise. * gcc.target/arm/ivopts-5.c: Likewise. * gcc.target/arm/pr43597.c: Likewise. * gcc.target/arm/pr43920-2.c: Likewise. * gcc.target/arm/pr45701-1.c: Skip scan-assembler on arm*-*-uclinuxfdpiceabi. * gcc.target/arm/pr45701-2.c: Likewise. * gcc.target/arm/stack-red-zone.c: Likewise. Change-Id: Icada7ce52537901fdac10403e7997571b7e2c509 -- 2.6.3 diff --git a/gcc/testsuite/gcc.dg/20020312-2.c b/gcc/testsuite/gcc.dg/20020312-2.c index 98af0d4..52c33d0 100644 --- a/gcc/testsuite/gcc.dg/20020312-2.c +++ b/gcc/testsuite/gcc.dg/20020312-2.c @@ -9,6 +9,7 @@ /* { dg-options "-O -fno-pic" } */ /* { dg-additional-options "-no-pie" { target pie_enabled } } */ /* { dg-require-effective-target nonlocal_goto } */ +/* { dg-skip-if "" { arm*-*-uclinuxfdpiceabi } "*" "" } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.target/arm/20051215-1.c b/gcc/testsuite/gcc.target/arm/20051215-1.c index 0519dc7..cc07693 100644 --- a/gcc/testsuite/gcc.target/arm/20051215-1.c +++ b/gcc/testsuite/gcc.target/arm/20051215-1.c @@ -3,6 +3,7 @@ the call would need an output reload. */ /* { dg-do run } */ /* { dg-options "-O2 -fno-omit-frame-pointer" } */ +/* { dg-skip-if "r9 is reserved in FDPIC" { arm*-*-uclinuxfdpiceabi } "*" "" } */ extern void abort (void); typedef void (*callback) (void); diff --git a/gcc/testsuite/gcc.target/arm/data-rel-2.c b/gcc/testsuite/gcc.target/arm/data-rel-2.c index 6ba47d6..7d37a8c 100644 --- a/gcc/testsuite/gcc.target/arm/data-rel-2.c +++ b/gcc/testsuite/gcc.target/arm/data-rel-2.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "Not supported in FDPIC" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-options "-fPIC -mno-pic-data-is-text-relative -mno-single-pic-base" } */ /* { dg-final { scan-assembler-not "j-\\(.LPIC" } } */ /* { dg-final { scan-assembler "_GLOBAL_OFFSET_TABLE_-\\(.LPIC" } } */ diff --git a/gcc/testsuite/gcc.target/arm/data-rel-3.c b/gcc/testsuite/gcc.target/arm/data-rel-3.c index 2ce1e66..534c6c4 100644 --- a/gcc/testsuite/gcc.target/arm/data-rel-3.c +++ b/gcc/testsuite/gcc.target/arm/data-rel-3.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "Not supported in FDPIC" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-options "-fPIC -mpic-data-is-text-relative" } */ /* { dg-final { scan-assembler "j-\\(.LPIC" } } */ /* { dg-final { scan-assembler-not "_GLOBAL_OFFSET_TABLE_-\\(.LPIC" } } */ diff --git a/gcc/testsuite/gcc.target/arm/ivopts-2.c b/gcc/testsuite/gcc.target/arm/ivopts-2.c index afe91aa..f1d5edb 100644 --- a/gcc/testsuite/gcc.target/arm/ivopts-2.c +++ b/gcc/testsuite/gcc.target/arm/ivopts-2.c @@ -14,4 +14,4 @@ tr4 (short array[], int n) /* { dg-final { scan-tree-dump-times "PHI X-Patchwork-Id: 173404 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4539374ilq; Mon, 9 Sep 2019 08:50:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXbJcu0XvLEVZbtdyPJaOfrmNmV5uDw05vQGq9SfPeRQVJNsPzQ3QdBSe3vgas2nwdllmB X-Received: by 2002:a50:eb81:: with SMTP id y1mr24922602edr.216.1568044259106; Mon, 09 Sep 2019 08:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044259; cv=none; d=google.com; s=arc-20160816; b=r9LIYj+B2nAt5dxwynwo3nEFd2bSGYFYfiNLe4XMtFxMd/ieoTM69hYhgfhRVZjrU9 0XjsfCLNXM8uXA23CPW1Fi9APQF440WQA39z/bLlgEFIDx1l3R7Jklu3K8dzCs5ijqMn lpIpaGcbaTzbCTyhNK0TxFDEr6gHYh6lWoogFFc89QNW/W1A7KhsbC6kcE/GJjaG7BcM EAXPUNjLa4fodVgeZn7ka7MdNq0F5B1hA7F+B2vRqgGzCzUsrtokBoe3CKeBAhtop8uG P+FnTDZnuO0NMvi6MW5WJh94K7e6T4GY4gl5WzIu/rnEyenBPN6YccpUcaeaBhZyDJK1 apRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=V+G6YBtvE+TCG0l4zg0mkxbBJ7/PhsVpV/C8lhJJxmM=; b=QDkqBxarvz/fRFCe7DVBSEy9/sh5uPSmOghGE0523edvwLwoOdaMM5tYzBCDm47+8p ZWmOLuvw41MiOL12yWSpL1iOy85y6p9NVry7MevtASj6ueR5Cdk+3anF8UsN/WjD9P3t SzXeviYxKxKWSpUIv4R0edyunzjGUfdiDodw0GA59C68LFKW5V7998Mi4IH9hd/UQ7qJ faR2HpUVzSeVyjfeN3NRK8RtcFVg+5fB9Zke/q0kQiDwAbZQf66L89ywworuJ59UtVy4 VVX5Z4PWtrs0pmFgqn4a0o6SsxU2dhukTEd6nFp4Ofq/f2A/IXax+TxP0rh9pG9Hu3tY 160A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=W9qBP9eV; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=kVbcjKkj; spf=pass (google.com: domain of gcc-patches-return-508657-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508657-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id pv20si7141841ejb.243.2019.09.09.08.50.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:50:59 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508657-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=W9qBP9eV; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=kVbcjKkj; spf=pass (google.com: domain of gcc-patches-return-508657-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508657-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=bjQ 3SV5GZ0U32sMJOP6fH0Ya3TUX1zLMTkO92ttxwX3T4xhtojRAK9Ax5cj8O31Xun1 4+zbAnp8YItoqon1wIAYJcTs3n8I3mDiuGzVb+c2QzT0tJhAmcvVVX6mNWTeopKg gZSqE6XVw4YpTVHByOiGUc7CJDLZXtCaobjvfw30= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=qyjGN3l8E 5S084osY6+jDCYKysc=; b=W9qBP9eV7afPgH7npvFqTqvpl4kHdq0ZxXBhy3UJc Ngb8O2Ws5HSZGNYVZC+2VHhGjHbxn8g2ONMDYrPumh+ElN/64V60t90+uEc7Pbu2 icRSil+/POnCmip+0vBQY+tX/w0xeERQHmX3+dv1HFE70r8XJGoCXknYpE6W3fyG xs= Received: (qmail 2491 invoked by alias); 9 Sep 2019 15:50:44 -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 2480 invoked by uid 89); 9 Sep 2019 15:50:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:50:42 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkAiF003533 for ; Mon, 9 Sep 2019 17:50:40 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=V+G6YBtvE+TCG0l4zg0mkxbBJ7/PhsVpV/C8lhJJxmM=; b=kVbcjKkjuiSvLqCd4Fq5IRetS5l0FKdBOkhWkbT6T1RTJtnVUOMLwUQ13BTqkMWkoYSy Oj2ItACQKrWDB1xPQuFjrCYs/DQj+Cc2fwjzsMui1fmnIAED0dJ4se+nla3QZXLRK9LS lHsYFSJq2zds3kTGeZQPwmiRq8RPcgSbPv4JUNptoyNNPTbgimcibANsW5HKFcY67mrs h8VK/EhQcrlFcEsznRr++msyLxIzSfCqJxYHUumUwz03foV/BV/PaZsUXqT/M6fK6Y7F 9VtOCzFByxX8Or96oUj2fqZSWTOG7Pe2zvLGUWgX6yr9ZEuM95kzgP/U3D9NrTiX9vpy PA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa7144-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:50:40 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 0E5A623 for ; Mon, 9 Sep 2019 15:50:36 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 129CF2ADEEE for ; Mon, 9 Sep 2019 17:50:36 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:50:35 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 15/24] [ARM][testsuite] FDPIC: Adjust scan-assembler patterns. Date: Mon, 9 Sep 2019 17:44:57 +0200 Message-ID: <20190909154526.11630-16-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon In FDPIC mode, r9 is saved in addition to other registers, so update the expected patterns accordingly. 2019-XX-XX Christophe Lyon Mickaël Guêné * gcc/testsuite/ * gcc.target/arm/interrupt-1.c: Add scan-assembler pattern for arm*-*-uclinuxfdpiceabi. * gcc.target/arm/interrupt-2.c: Likewise. * gcc.target/arm/pr70830.c: Likewise. Change-Id: Id946b79bacc32be585c31e60a355191f104cc29e -- 2.6.3 diff --git a/gcc/testsuite/gcc.target/arm/interrupt-1.c b/gcc/testsuite/gcc.target/arm/interrupt-1.c index fe94877..493763d 100644 --- a/gcc/testsuite/gcc.target/arm/interrupt-1.c +++ b/gcc/testsuite/gcc.target/arm/interrupt-1.c @@ -13,5 +13,7 @@ void foo () bar (0); } -/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, fp, ip, lr}" } } */ -/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, pc}\\^" } } */ +/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, fp, ip, lr}" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, pc}\\^" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, r5, r9, fp, ip, lr}" { target arm*-*-uclinuxfdpiceabi } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, r9, fp, ip, pc}\\^" { target arm*-*-uclinuxfdpiceabi } } } */ diff --git a/gcc/testsuite/gcc.target/arm/interrupt-2.c b/gcc/testsuite/gcc.target/arm/interrupt-2.c index 289eca0..5be1f16 100644 --- a/gcc/testsuite/gcc.target/arm/interrupt-2.c +++ b/gcc/testsuite/gcc.target/arm/interrupt-2.c @@ -15,5 +15,7 @@ void test() foo = 0; } -/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, r5, ip, lr}" } } */ -/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, pc}\\^" } } */ +/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, r5, ip, lr}" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, pc}\\^" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, r5, r6, r9, ip, lr}" { target arm*-*-uclinuxfdpiceabi } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, r6, r9, ip, pc}\\^" { target arm*-*-uclinuxfdpiceabi } } } */ diff --git a/gcc/testsuite/gcc.target/arm/pr70830.c b/gcc/testsuite/gcc.target/arm/pr70830.c index cad903b..cd84c42 100644 --- a/gcc/testsuite/gcc.target/arm/pr70830.c +++ b/gcc/testsuite/gcc.target/arm/pr70830.c @@ -11,4 +11,5 @@ void __attribute__ ((interrupt ("IRQ"))) dm3730_IRQHandler(void) { prints("IRQ" ); } -/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, ip, pc}\\^" } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, ip, pc}\\^" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r9, ip, pc}\\^" { target arm*-*-uclinuxfdpiceabi } } } */ From patchwork Mon Sep 9 15:44:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173405 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4539751ilq; Mon, 9 Sep 2019 08:51:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvfBSI/Trai8xqhj+FfIFvUflUhxsBWKK5yFheihZSrc3Qnp5fYxVNMSho4cXEWpm4sDWl X-Received: by 2002:a05:6402:1426:: with SMTP id c6mr8728737edx.53.1568044276647; Mon, 09 Sep 2019 08:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044276; cv=none; d=google.com; s=arc-20160816; b=raqNYtQkjvhPxCrRbcnDUIcGDlrIATph6S7PYkUxAlxLHg+xciXWzXv+j46evhMUuq 9GGoEtqnNF5d5lw3U7pTwLjabhLa5pRP3ruvpOychb1fWOoSg6FDKIRK9zAn6O2NBKv/ 1GohpDWicL4eeIyZnSRID0RZxeYOnanVdIqASamCm+hbqnBITtdPBt4OFw8qFZTaLCmu GbBPC+07xm9Wu+OCyrHxvEtnYvZstpcV0gmBb4iTAzvOH/bZ/QDdnnOZP3/dIdDI/SA2 1i3rku4EnMUaAufrNGq2vLblD3cEPQ2MFBf8Pfr2svYw+tLpeKpD0oteasUyhiO7tzKu IDdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=4hWG6cwfwKnhzInk8p4B7njAiaMGipAcBR172XOEFgM=; b=iw16lAg8BTztE7TZkOBcml/QsuicEIWAxx5sXB9wsLBYtSiUm/pBlO/c13I4CSG/Sw tq1Q3YTkLAE28YTSasjQf2l8D0WtQBCdo05e4HqhNIzr6xSm2Mlqah+qSnyrvwcIoUPH FsHK2hnqB1ZWuHxiho35cWJjBcbM9pRpc9sJdMsh2N0Hw56gwPpmdUDKHGhHIk6HCqsG 0yDkwjRqdcaB8GzUhhiPOy8hs+rNmPX4grAsPwNUSOeLMVCfPSih4lHZl+4vb6E5bzxC MThCx3SgveGBfLJ0RlH1PADNuOEyVAcpSFXCm4M6WX2J/NpIMKwBlYTT8DoMHprurMM6 Jiow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=hbCFkrlB; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=xqy2Ag6r; spf=pass (google.com: domain of gcc-patches-return-508658-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508658-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id f17si10497691eda.232.2019.09.09.08.51.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:51:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508658-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=hbCFkrlB; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=xqy2Ag6r; spf=pass (google.com: domain of gcc-patches-return-508658-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508658-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=wYxuwUc+oQt7lKUElypuuE486Zv0G JV69QSLat5sKb6BlfdW7PAQdJvkYqpr++7jWcXY9uIFNJtgCD8Dw4RlWhg9OqOqx RyVKZmpAOUs/99ha4RglPBovwpshvVZshwckomXo0e0O3NJYzbn08S7yMDNEaBk7 DrUvjwc+5RwATQ= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=WgkWMKvAux4f2O9HtffyjobDoXs=; b=hbC FkrlBfJ++ZAeUrrKuyT+RyWZCMPxmJUwT9NcPTz1wm4145/jRasvJW7PRC8QAlig NUH5PdSyJc7Mi4NmKC3+7gHUOIitDOyKvoxl3qY8tX0XHN1doc607Y6aSNJKr8bt G97UPhSg/lsKxa2z7VPpK+aGSCQ5vlxl0g0Kx5O0= Received: (qmail 4054 invoked by alias); 9 Sep 2019 15:51: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 4045 invoked by uid 89); 9 Sep 2019 15:51:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=*-*-darwin*, **darwin*, gdwarf2, gdwarf-2 X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:51:02 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkMPt001274 for ; Mon, 9 Sep 2019 17:50:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=4hWG6cwfwKnhzInk8p4B7njAiaMGipAcBR172XOEFgM=; b=xqy2Ag6r6Rnr7gM+cd4OAy0Em1B1ZYso+XrDX3CDgx5TrKj9g6Vs+LoqKKI58qwff0lx vTqv3FbiWuSJYYBwE9s0jIQHMiUt0jaUmfAZVfmQCdDp0b+l+nmePzpcrSSColP0df90 2eaDNtw3hyPDz7u1XKj7liVY5AabBtD647XHxq2MZfrbHPNknG2v/J54PnlBD1cj7q0Y RnHmXlJ+VhxEWuHRlOH/z95w6fWHov2CQYUmFFxWvZinx2NOt4yW3AYP8YujN8nBpGcF /hRbs92vFycKZ0PsNmJA36b11YvYfg3DUIs+2jiHmwu+ZFuliuSURKU/MsM4JyK/bh/c CQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212eksu-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:50:59 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id DEC644B for ; Mon, 9 Sep 2019 15:50:56 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 4B6C52ADEEE for ; Mon, 9 Sep 2019 17:50:56 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:50:55 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 16/24] [ARM][testsuite] FDPIC: Skip tests that don't work in PIC mode Date: Mon, 9 Sep 2019 17:44:58 +0200 Message-ID: <20190909154526.11630-17-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Some tests fail on arm*-*-uclinuxfdpiceabi because it generates PIC code and they don't support it: skip them. They also fail on arm*-linux* when forcing -fPIC. 2019-XX-XX Christophe Lyon gcc/testsuite/ * gcc.target/arm/eliminate.c: Accept only nonpic targets. * g++.dg/other/anon5.C: Likewise. Change-Id: I8efb8d356ce25b020c44a84b07f79a996dca0358 -- 2.6.3 diff --git a/gcc/testsuite/g++.dg/other/anon5.C b/gcc/testsuite/g++.dg/other/anon5.C index ee4601e..dadd92e 100644 --- a/gcc/testsuite/g++.dg/other/anon5.C +++ b/gcc/testsuite/g++.dg/other/anon5.C @@ -1,5 +1,6 @@ // PR c++/34094 // { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* } } } } +// { dg-require-effective-target nonpic } // { dg-options "-gdwarf-2" } // Ignore additional message on powerpc-ibm-aix // { dg-prune-output "obtain more information" } */ diff --git a/gcc/testsuite/gcc.target/arm/eliminate.c b/gcc/testsuite/gcc.target/arm/eliminate.c index f254dd8..299d4df 100644 --- a/gcc/testsuite/gcc.target/arm/eliminate.c +++ b/gcc/testsuite/gcc.target/arm/eliminate.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target { nonpic } } } */ /* { dg-options "-O2" } */ struct X From patchwork Mon Sep 9 15:44:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173406 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4540226ilq; Mon, 9 Sep 2019 08:51:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzluySRzLrXOMOf9VAOae1w5ES1a8oROhL84iflNnC1i20mGvGevqrj3PLbXi7+4aYWm8mN X-Received: by 2002:a17:906:4d4b:: with SMTP id b11mr20425964ejv.0.1568044300793; Mon, 09 Sep 2019 08:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044300; cv=none; d=google.com; s=arc-20160816; b=lAT0IffmZODAlsoIKlAxL2sVZWlmSmf2VE069CtdaN6uPJO3NLCq50P/FjMwJ6U6fw XFqL8ZWl4KNlGDUD/zNkQ2T5SyILAzz6mjfzvRJv78l0MUP1v7E0L7fPzGaqoeVdE3hQ P8xv6lOQFNv0QCM3eAv5s+SAiMIwTz9cyriZ4XKC3WaMAaTQK6Lqjo3kldi0xupSezZX 5qAPFfqZ186csevtigVJ7KfSe7xxMZ+DtXGK+UDFP9aKFgN4+oA+p1OGAkEVrlWwVBl3 8LKNjCSyw2sXnLt1G+ra4Yt8o85b0a3VA3FibAMH4w34oZns+c4SjDpX4C6LShcsu8fZ 2Sow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=dRpwbPrzXRMJoeGKJjDI2r+VJdkFHBiijHklafju9fQ=; b=gD4d37jQIVocWG/4MLvannCMPcNj7iazsOoJ6kgtOZsuQzyNjrWxTG/n75WZHE5y7Y Gq9b1CAibMk9EcHo94gWq4DGlduG09TAIS1ZlFUSxqIIiiuG3NVsqr0VMLGsh/n4q+eO EeES1rcoPKPGMGYmokL2DfqWkdYOt/TUbOURoli7xYKV45KWPqKtC+HXavNvlTvlqMZh Zg8m6WlBToBfRTyTGMzYvpY5SvfdNUJ4mYJPLARfifw2dTNvMxCfAjwOgD1DMKL/NwuV d/nj2MllMrM2052G1khrc4wOn6HV266Gd2xp1UoK3r4P9AiqexPU1/iDGss1n7RVWibB eucA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="APHu5/IB"; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=QK5PNUZ4; spf=pass (google.com: domain of gcc-patches-return-508659-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508659-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c19si7960260ejr.389.2019.09.09.08.51.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:51:40 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508659-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="APHu5/IB"; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=QK5PNUZ4; spf=pass (google.com: domain of gcc-patches-return-508659-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508659-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=YqHUCj+EAlpqisx0aEYAcWP/FM/aU pYUrlU2CaW+474zP1ljktWOflDxDwIgrj0j2KUiMDCzTbwhv2T57HivT/vxlJEaT tEVq/TZOJhr9r58XSbNoDh8NXG7KdiCHUn4YHB08Zs/RBffv9msXLfGP4znYRkFj HxBItiWya9dJDE= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=gr7aLgVGbg4RYSefRZquc4RBu6o=; b=APH u5/IB2G0uxkvKd6YctJCLheCmOb9mpfuapM0tJ6+3lWb+EJzoAF2dubhiBayU0SW K+OrjoaPtrn6JpPKTTgFPNGXwlJMQ5zttJQ4AKsdAlJLy/ClFTAYaRNzJD9dEffB h1idnhKhiKGRZ+N0j1IA2lgLeksrQ4DSeD+09Uoc= Received: (qmail 5589 invoked by alias); 9 Sep 2019 15:51:26 -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 5581 invoked by uid 89); 9 Sep 2019 15:51:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Origin X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:51:22 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpDJd005011 for ; Mon, 9 Sep 2019 17:51:20 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=dRpwbPrzXRMJoeGKJjDI2r+VJdkFHBiijHklafju9fQ=; b=QK5PNUZ4oNuXHDwi2tdZupPrL6ygSgDONdgApUI3LuXESK5KrF0QDb3SzjTuQUT6Hc29 GRtJTvW0717U6D6sQIsdka4IXXG1m9CpxM4h7VG6nxh8ogNiCn9wDv3rFqC1t34rwUkS E6oJo51BDqLy1PjFICuy4uDDWRVxOMd9VsmgVayVR0L2CueO+N0oMqHzlvy4+CuHTnK3 NKsD3SUyU5MaeuMeBM85WpE/qKfixYDTo+tklIqJxdiLaDI3jNysIsuXP4l4bRObqCnN CcNjDNJp/qfn1pi3RfqqtyWhqF6Z67Hf66Ih870Yp9B2yOuJM3DWZHcIdAwdYrmZtc60 IQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212ekup-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:51:20 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 2D9944C for ; Mon, 9 Sep 2019 15:51:17 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 8D0672B0E11 for ; Mon, 9 Sep 2019 17:51:16 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:51:16 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 17/24] [ARM][testsuite] FDPIC: Handle *-*-uclinux* Date: Mon, 9 Sep 2019 17:44:59 +0200 Message-ID: <20190909154526.11630-18-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Add *-*-uclinux* to tests that work on this target. 2019-XX-XX Christophe Lyon gcc/testsuite/ * g++.dg/abi/forced.C: Add *-*-uclinux*. * g++.dg/abi/guard2.C: Likewise. * g++.dg/ext/cleanup-10.C: Likewise. * g++.dg/ext/cleanup-11.C: Likewise. * g++.dg/ext/cleanup-8.C: Likewise. * g++.dg/ext/cleanup-9.C: Likewise. * g++.dg/ext/sync-4.C: Likewise. * g++.dg/ipa/comdat.C: Likewise. * gcc.dg/20041106-1.c: Likewise. * gcc.dg/cleanup-10.c: Likewise. * gcc.dg/cleanup-11.c: Likewise. * gcc.dg/cleanup-8.c: Likewise. * gcc.dg/cleanup-9.c: Likewise. * gcc.dg/fdata-sections-1.c: Likewise. * gcc.dg/fdata-sections-2.c: Likewise. * gcc.dg/pr39323-1.c: Likewise. * gcc.dg/pr39323-2.c: Likewise. * gcc.dg/pr39323-3.c: Likewise. * gcc.dg/pr65780-1.c: Likewise. * gcc.dg/pr65780-2.c: Likewise. * gcc.dg/pr67338.c: Likewise. * gcc.dg/pr78185.c: Likewise. * gcc.dg/pr83100-1.c: Likewise. * gcc.dg/pr83100-4.c: Likewise. * gcc.dg/strlenopt-12g.c: Likewise. * gcc.dg/strlenopt-14g.c: Likewise. * gcc.dg/strlenopt-14gf.c: Likewise. * gcc.dg/strlenopt-16g.c: Likewise. * gcc.dg/strlenopt-17g.c: Likewise. * gcc.dg/strlenopt-18g.c: Likewise. * gcc.dg/strlenopt-1f.c: Likewise. * gcc.dg/strlenopt-22g.c: Likewise. * gcc.dg/strlenopt-2f.c: Likewise. * gcc.dg/strlenopt-31g.c: Likewise. * gcc.dg/strlenopt-33g.c: Likewise. * gcc.dg/strlenopt-4g.c: Likewise. * gcc.dg/strlenopt-4gf.c: Likewise. * gcc.dg/strncmp-2.c: Likewise. * gcc.dg/struct-ret-3.c: Likewise. * gcc.dg/torture/pr69760.c: Likewise. * gcc.target/arm/div64-unwinding.c: Likewise. * gcc.target/arm/stack-checking.c: Likewise. * gcc.target/arm/synchronize.c: Likewise. * gcc.target/arm/pr66912.c: Add arm*-*-uclinuxfdpiceabi. * lib/target-supports.exp (check_effective_target_pie): Likewise. (check_effective_target_sync_long_long_runtime): Likewise. (check_effective_target_sync_int_long): Likewise. (check_effective_target_sync_char_short): Likewise. Change-Id: I89bfea79d4490c5df0b6470def5a31d7f31ac2cc -- 2.6.3 diff --git a/gcc/testsuite/g++.dg/abi/forced.C b/gcc/testsuite/g++.dg/abi/forced.C index 0e6be28..2d1ec53 100644 --- a/gcc/testsuite/g++.dg/abi/forced.C +++ b/gcc/testsuite/g++.dg/abi/forced.C @@ -1,4 +1,4 @@ -// { dg-do run { target *-*-linux* *-*-gnu* } } +// { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } // { dg-options "-pthread" } #include diff --git a/gcc/testsuite/g++.dg/abi/guard2.C b/gcc/testsuite/g++.dg/abi/guard2.C index c35fa7e..74139a8 100644 --- a/gcc/testsuite/g++.dg/abi/guard2.C +++ b/gcc/testsuite/g++.dg/abi/guard2.C @@ -1,6 +1,6 @@ // PR c++/41611 // Test that the guard gets its own COMDAT group. -// { dg-final { scan-assembler "_ZGVZN1A1fEvE1i,comdat" { target *-*-linux* *-*-gnu* } } } +// { dg-final { scan-assembler "_ZGVZN1A1fEvE1i,comdat" { target *-*-linux* *-*-gnu* *-*-uclinux* } } } struct A { static int f() diff --git a/gcc/testsuite/g++.dg/ext/cleanup-10.C b/gcc/testsuite/g++.dg/ext/cleanup-10.C index 66c7b76..56aeb66 100644 --- a/gcc/testsuite/g++.dg/ext/cleanup-10.C +++ b/gcc/testsuite/g++.dg/ext/cleanup-10.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through signal frames on alternate stack. */ diff --git a/gcc/testsuite/g++.dg/ext/cleanup-11.C b/gcc/testsuite/g++.dg/ext/cleanup-11.C index 6e96521..c6d3560 100644 --- a/gcc/testsuite/g++.dg/ext/cleanup-11.C +++ b/gcc/testsuite/g++.dg/ext/cleanup-11.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through realtime signal frames on alternate stack. */ diff --git a/gcc/testsuite/g++.dg/ext/cleanup-8.C b/gcc/testsuite/g++.dg/ext/cleanup-8.C index ccf9bef..e99508d 100644 --- a/gcc/testsuite/g++.dg/ext/cleanup-8.C +++ b/gcc/testsuite/g++.dg/ext/cleanup-8.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through signal frames. */ diff --git a/gcc/testsuite/g++.dg/ext/cleanup-9.C b/gcc/testsuite/g++.dg/ext/cleanup-9.C index dcdfcae..45e5f90 100644 --- a/gcc/testsuite/g++.dg/ext/cleanup-9.C +++ b/gcc/testsuite/g++.dg/ext/cleanup-9.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through realtime signal frames. */ diff --git a/gcc/testsuite/g++.dg/ext/sync-4.C b/gcc/testsuite/g++.dg/ext/sync-4.C index 8a2de48..029afb0 100644 --- a/gcc/testsuite/g++.dg/ext/sync-4.C +++ b/gcc/testsuite/g++.dg/ext/sync-4.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* FIXME The following additional option should be removed after the fix for radr://19802258. /* { dg-xfail-run-if "PR60563 radr://19802258" { *-*-darwin* } } */ /* { dg-require-effective-target sync_long_long_runtime } */ diff --git a/gcc/testsuite/g++.dg/ipa/comdat.C b/gcc/testsuite/g++.dg/ipa/comdat.C index 1945e32..f3df99a 100644 --- a/gcc/testsuite/g++.dg/ipa/comdat.C +++ b/gcc/testsuite/g++.dg/ipa/comdat.C @@ -1,4 +1,4 @@ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-ipa-comdats" } */ #include __attribute__ ((noinline)) diff --git a/gcc/testsuite/gcc.dg/20041106-1.c b/gcc/testsuite/gcc.dg/20041106-1.c index cba4a06..95579ff 100644 --- a/gcc/testsuite/gcc.dg/20041106-1.c +++ b/gcc/testsuite/gcc.dg/20041106-1.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* *-*-uclinux* } } */ /* { dg-options -O2 } */ #include diff --git a/gcc/testsuite/gcc.dg/cleanup-10.c b/gcc/testsuite/gcc.dg/cleanup-10.c index 1af63ea..9fc8658 100644 --- a/gcc/testsuite/gcc.dg/cleanup-10.c +++ b/gcc/testsuite/gcc.dg/cleanup-10.c @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through signal frames diff --git a/gcc/testsuite/gcc.dg/cleanup-11.c b/gcc/testsuite/gcc.dg/cleanup-11.c index c1f19fe..6b499d4 100644 --- a/gcc/testsuite/gcc.dg/cleanup-11.c +++ b/gcc/testsuite/gcc.dg/cleanup-11.c @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through realtime signal diff --git a/gcc/testsuite/gcc.dg/cleanup-8.c b/gcc/testsuite/gcc.dg/cleanup-8.c index 45abdb2..87f4186 100644 --- a/gcc/testsuite/gcc.dg/cleanup-8.c +++ b/gcc/testsuite/gcc.dg/cleanup-8.c @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through signal diff --git a/gcc/testsuite/gcc.dg/cleanup-9.c b/gcc/testsuite/gcc.dg/cleanup-9.c index 98dc268..d34ce12 100644 --- a/gcc/testsuite/gcc.dg/cleanup-9.c +++ b/gcc/testsuite/gcc.dg/cleanup-9.c @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through realtime diff --git a/gcc/testsuite/gcc.dg/fdata-sections-1.c b/gcc/testsuite/gcc.dg/fdata-sections-1.c index 51686b9..e8a6639 100644 --- a/gcc/testsuite/gcc.dg/fdata-sections-1.c +++ b/gcc/testsuite/gcc.dg/fdata-sections-1.c @@ -1,7 +1,7 @@ /* PR middle-end/15486 */ /* Origin: Jonathan Larmour */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-fdata-sections" } */ int x; diff --git a/gcc/testsuite/gcc.dg/fdata-sections-2.c b/gcc/testsuite/gcc.dg/fdata-sections-2.c index dda90ba7..48d44a2 100644 --- a/gcc/testsuite/gcc.dg/fdata-sections-2.c +++ b/gcc/testsuite/gcc.dg/fdata-sections-2.c @@ -4,7 +4,7 @@ /* This checks that string constants are put in per-function rodata sections, so that they can be garbage collected. */ -/* { dg-do compile { target *-*-linux* } } */ +/* { dg-do compile { target *-*-linux* *-*-uclinux* } } */ /* { dg-options "-O -ffunction-sections -fdata-sections" } */ const char *f1(void) { return "falderalde"; } diff --git a/gcc/testsuite/gcc.dg/pr39323-1.c b/gcc/testsuite/gcc.dg/pr39323-1.c index 7a7fd63..d84009c 100644 --- a/gcc/testsuite/gcc.dg/pr39323-1.c +++ b/gcc/testsuite/gcc.dg/pr39323-1.c @@ -1,5 +1,5 @@ /* PR c/39323 - MAX_OFILE_ALIGNMENT in elfos.h is too big */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ int foo __attribute__ ((aligned(1 << 29))) = 20; /* { dg-error "requested alignment" } */ typedef int __attribute__ ((aligned(1 << 29))) int29; /* { dg-error "requested alignment" } */ diff --git a/gcc/testsuite/gcc.dg/pr39323-2.c b/gcc/testsuite/gcc.dg/pr39323-2.c index a870729..6b6cb2e 100644 --- a/gcc/testsuite/gcc.dg/pr39323-2.c +++ b/gcc/testsuite/gcc.dg/pr39323-2.c @@ -1,5 +1,5 @@ /* PR c/39323 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ int bar __attribute__ ((aligned(1 << 28))) = 20; diff --git a/gcc/testsuite/gcc.dg/pr39323-3.c b/gcc/testsuite/gcc.dg/pr39323-3.c index b452d3c..2e2c1a2 100644 --- a/gcc/testsuite/gcc.dg/pr39323-3.c +++ b/gcc/testsuite/gcc.dg/pr39323-3.c @@ -1,5 +1,5 @@ /* PR c/39323 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ typedef int __attribute__ ((aligned(1 << 28))) int28; int28 foo = 20; diff --git a/gcc/testsuite/gcc.dg/pr65780-1.c b/gcc/testsuite/gcc.dg/pr65780-1.c index b586211..5e3226e 100644 --- a/gcc/testsuite/gcc.dg/pr65780-1.c +++ b/gcc/testsuite/gcc.dg/pr65780-1.c @@ -1,5 +1,5 @@ /* PR target/65780 */ -/* { dg-do link { target *-*-linux* *-*-gnu* } } */ +/* { dg-do link { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2" } */ int optopt; diff --git a/gcc/testsuite/gcc.dg/pr65780-2.c b/gcc/testsuite/gcc.dg/pr65780-2.c index bff3323..932cbe1 100644 --- a/gcc/testsuite/gcc.dg/pr65780-2.c +++ b/gcc/testsuite/gcc.dg/pr65780-2.c @@ -1,5 +1,5 @@ /* PR target/65780 */ -/* { dg-do link { target *-*-linux* *-*-gnu* } } */ +/* { dg-do link { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-require-effective-target pie } */ /* { dg-options "-O2 -fpie" } */ diff --git a/gcc/testsuite/gcc.dg/pr67338.c b/gcc/testsuite/gcc.dg/pr67338.c index 0fdc302..7bfbef2 100644 --- a/gcc/testsuite/gcc.dg/pr67338.c +++ b/gcc/testsuite/gcc.dg/pr67338.c @@ -1,4 +1,4 @@ /* PR c/67338 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ struct S { __attribute__((aligned (1 << 28))) double a; }; diff --git a/gcc/testsuite/gcc.dg/pr78185.c b/gcc/testsuite/gcc.dg/pr78185.c index 405f748..d7781b2 100644 --- a/gcc/testsuite/gcc.dg/pr78185.c +++ b/gcc/testsuite/gcc.dg/pr78185.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O" } */ #include diff --git a/gcc/testsuite/gcc.dg/pr83100-1.c b/gcc/testsuite/gcc.dg/pr83100-1.c index 233c1f6..ccfb8c6 100644 --- a/gcc/testsuite/gcc.dg/pr83100-1.c +++ b/gcc/testsuite/gcc.dg/pr83100-1.c @@ -1,5 +1,5 @@ /* PR target/83100 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fcommon -fdata-sections" } */ const int a; diff --git a/gcc/testsuite/gcc.dg/pr83100-4.c b/gcc/testsuite/gcc.dg/pr83100-4.c index bb26735..2f83247 100644 --- a/gcc/testsuite/gcc.dg/pr83100-4.c +++ b/gcc/testsuite/gcc.dg/pr83100-4.c @@ -1,5 +1,5 @@ /* PR target/83100 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fno-common -fdata-sections" } */ const int a; diff --git a/gcc/testsuite/gcc.dg/strlenopt-12g.c b/gcc/testsuite/gcc.dg/strlenopt-12g.c index f1dec1f..fb0eeb2 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-12g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-12g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-14g.c b/gcc/testsuite/gcc.dg/strlenopt-14g.c index 1368ed3..81ddcc2 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-14g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-14g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy and mempcpy functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ /* Bionic targets don't have mempcpy */ /* { dg-require-effective-target non_bionic } */ diff --git a/gcc/testsuite/gcc.dg/strlenopt-14gf.c b/gcc/testsuite/gcc.dg/strlenopt-14gf.c index f7db2a8..54cff83 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-14gf.c +++ b/gcc/testsuite/gcc.dg/strlenopt-14gf.c @@ -1,6 +1,6 @@ /* This test needs runtime that provides stpcpy, mempcpy and __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ /* Bionic targets don't have mempcpy */ /* { dg-require-effective-target non_bionic } */ diff --git a/gcc/testsuite/gcc.dg/strlenopt-16g.c b/gcc/testsuite/gcc.dg/strlenopt-16g.c index 816cbbc..e847a7a 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-16g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-16g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-17g.c b/gcc/testsuite/gcc.dg/strlenopt-17g.c index aa86f78..9e6373c 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-17g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-17g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-18g.c b/gcc/testsuite/gcc.dg/strlenopt-18g.c index de692e0..0c219b8 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-18g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-18g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-1f.c b/gcc/testsuite/gcc.dg/strlenopt-1f.c index 4e3abd9..e7d817f 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-1f.c +++ b/gcc/testsuite/gcc.dg/strlenopt-1f.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinu* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define FORTIFY_SOURCE 2 diff --git a/gcc/testsuite/gcc.dg/strlenopt-22g.c b/gcc/testsuite/gcc.dg/strlenopt-22g.c index 1ecb85e..6ee6bef 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-22g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-22g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-2f.c b/gcc/testsuite/gcc.dg/strlenopt-2f.c index 5786f8a..c0c7f38 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-2f.c +++ b/gcc/testsuite/gcc.dg/strlenopt-2f.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define FORTIFY_SOURCE 2 diff --git a/gcc/testsuite/gcc.dg/strlenopt-31g.c b/gcc/testsuite/gcc.dg/strlenopt-31g.c index 4eff864..eee4b57 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-31g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-31g.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-33g.c b/gcc/testsuite/gcc.dg/strlenopt-33g.c index a814160..1950008 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-33g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-33g.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-4g.c b/gcc/testsuite/gcc.dg/strlenopt-4g.c index 88dcec6..bf8aebb 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-4g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-4g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-4gf.c b/gcc/testsuite/gcc.dg/strlenopt-4gf.c index 033661a..16eb5b0 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-4gf.c +++ b/gcc/testsuite/gcc.dg/strlenopt-4gf.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy and __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strncmp-2.c b/gcc/testsuite/gcc.dg/strncmp-2.c index f5555ba..6818b30 100644 --- a/gcc/testsuite/gcc.dg/strncmp-2.c +++ b/gcc/testsuite/gcc.dg/strncmp-2.c @@ -1,5 +1,5 @@ /* Test strncmp builtin expansion for compilation and proper execution. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2" } */ /* { dg-require-effective-target ptr32plus } */ diff --git a/gcc/testsuite/gcc.dg/struct-ret-3.c b/gcc/testsuite/gcc.dg/struct-ret-3.c index 4083bb4..4c0a0e6 100644 --- a/gcc/testsuite/gcc.dg/struct-ret-3.c +++ b/gcc/testsuite/gcc.dg/struct-ret-3.c @@ -1,7 +1,7 @@ /* PR middle-end/31309 */ /* Origin: Peeter Joot */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-add-options stack_size } */ #include diff --git a/gcc/testsuite/gcc.dg/torture/pr69760.c b/gcc/testsuite/gcc.dg/torture/pr69760.c index 8f24608..53733c7 100644 --- a/gcc/testsuite/gcc.dg/torture/pr69760.c +++ b/gcc/testsuite/gcc.dg/torture/pr69760.c @@ -1,5 +1,5 @@ /* PR tree-optimization/69760 */ -/* { dg-do run { target { { *-*-linux* *-*-gnu* } && mmap } } } */ +/* { dg-do run { target { { *-*-linux* *-*-gnu* *-*-uclinux* } && mmap } } } */ /* { dg-options "-O2" } */ #include diff --git a/gcc/testsuite/gcc.target/arm/div64-unwinding.c b/gcc/testsuite/gcc.target/arm/div64-unwinding.c index 7f112ee..0944281 100644 --- a/gcc/testsuite/gcc.target/arm/div64-unwinding.c +++ b/gcc/testsuite/gcc.target/arm/div64-unwinding.c @@ -1,6 +1,6 @@ /* Performing a 64-bit division should not pull in the unwinder. */ -/* { dg-do run { target { ! *-*-linux* } } } */ +/* { dg-do run { target { { ! *-*-linux* } && { ! *-*-uclinux* } } } } */ /* { dg-options "-O0" } */ #include diff --git a/gcc/testsuite/gcc.target/arm/pr66912.c b/gcc/testsuite/gcc.target/arm/pr66912.c index 27e4c45..7e6294c 100644 --- a/gcc/testsuite/gcc.target/arm/pr66912.c +++ b/gcc/testsuite/gcc.target/arm/pr66912.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target *-*-linux* } } */ +/* { dg-do compile { target *-*-linux* arm*-*-uclinuxfdpiceabi } } */ /* { dg-options "-O2 -fpic" } */ __attribute__((visibility("protected"))) diff --git a/gcc/testsuite/gcc.target/arm/stack-checking.c b/gcc/testsuite/gcc.target/arm/stack-checking.c index 4b53bed..9d1d2b0 100644 --- a/gcc/testsuite/gcc.target/arm/stack-checking.c +++ b/gcc/testsuite/gcc.target/arm/stack-checking.c @@ -1,4 +1,4 @@ -/* { dg-do run { target { *-*-linux* } } } */ +/* { dg-do run { target { *-*-linux* *-*-uclinux* } } } */ /* { dg-require-stack-check "" } */ /* { dg-options "-fstack-check" } */ diff --git a/gcc/testsuite/gcc.target/arm/synchronize.c b/gcc/testsuite/gcc.target/arm/synchronize.c index 7ef10e2..912f407 100644 --- a/gcc/testsuite/gcc.target/arm/synchronize.c +++ b/gcc/testsuite/gcc.target/arm/synchronize.c @@ -1,4 +1,4 @@ -/* { dg-final { scan-assembler "__sync_synchronize|dmb|mcr" { target arm*-*-linux-* } } } */ +/* { dg-final { scan-assembler "__sync_synchronize|dmb|mcr" { target arm*-*-linux-* arm*-*-uclinux* } } } */ void *foo (void) { diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index e32d424..0b67e10 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1202,6 +1202,7 @@ proc check_effective_target_pie { } { || [istarget *-*-dragonfly*] || [istarget *-*-freebsd*] || [istarget *-*-linux*] + || [istarget arm*-*-uclinuxfdpiceabi] || [istarget *-*-gnu*] || [istarget *-*-amdhsa]} { return 1; @@ -6853,6 +6854,7 @@ proc check_effective_target_sync_long_long_runtime { } { } "" }]) || [istarget aarch64*-*-*] + || [istarget arm*-*-uclinuxfdpiceabi] || ([istarget arm*-*-linux-*] && [check_runtime sync_longlong_runtime { #include @@ -6912,6 +6914,7 @@ proc check_effective_target_sync_int_long { } { || [istarget aarch64*-*-*] || [istarget alpha*-*-*] || [istarget arm*-*-linux-*] + || [istarget arm*-*-uclinuxfdpiceabi] || ([istarget arm*-*-*] && [check_effective_target_arm_acq_rel]) || [istarget bfin*-*linux*] @@ -6935,6 +6938,7 @@ proc check_effective_target_sync_char_short { } { || [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget alpha*-*-*] || [istarget arm*-*-linux-*] + || [istarget arm*-*-uclinuxfdpiceabi] || ([istarget arm*-*-*] && [check_effective_target_arm_acq_rel]) || [istarget hppa*-*linux*] From patchwork Mon Sep 9 15:45:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173407 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4540553ilq; Mon, 9 Sep 2019 08:52:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzH7IjuAoIY/hd+wy3Q+omvaDDA6fh0TqQSLpINEzIofmuWcQgSDYoe4Yjy4uBv/jVFWd7F X-Received: by 2002:a50:981b:: with SMTP id g27mr25225503edb.105.1568044320987; Mon, 09 Sep 2019 08:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044320; cv=none; d=google.com; s=arc-20160816; b=FStFuHxBFgaK8xqX4ygMUp1rAlgq2DhfhAPD8eEnUd9sF6wnHQzkPGAbZFf2fIEvAo 7gdgMKdPQXCMC0t9rC5jzH9VYWs8dFhuIHWMLS5mUWcGQIQHQIx2D5mgWL6zPlMToC82 X030WVE1d+oXK47/NVJZVDVtxncbonfgZkFpr1e8EDXuVI59MI/FjXm/xjF83qLwoG7y Dfrj8W6PAwa4R0aVMtpLvMX9xaldq0kOu24C8RtVbhrPxNIgq9URe6aKWNyjZWJVKKdV ag0EUHQCgI+1VHmDnts7H+Rzi2LzynJSxV1waQpueEFa9BOLCnyRk806lugcbGQ3tm6f dL9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=v03MGAh9dunlD1jr7tJ7hiOjNO+/TXG8J+jJJLwu7pQ=; b=abHPQgDAOFK2OuDzQgf7wUS5ClkoNqoQRXKYflJ1aWSDXgZ1lUGoBpGEg36QPvrTfK my2KGnfBbjfHtfpAUV+b8vS5IeW1dhK8NW69dnYmuUIvxUhihGHiH9hkEDCMTYSjr+7S jX8n38UsN5HiPFCvApVMuSr6uDYCA071CcdleYGZWoXR8/o4OQutA74NtO/kQaKl5z1I hoe37HZIzeN/RGlSOYpgCrR1WPM4Xb33HfUWfaHv0XHbEChy2m2fYTmS6hwyJbKs/+dh JPRQAONKnjW51wpya/2RnL3EJZfgbRqNEY5UQtu6qSU5o4FSuPNXva90Yl8O6ILLp9Nc nhSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ILFAi3d3; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=szhe4Xk8; spf=pass (google.com: domain of gcc-patches-return-508660-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508660-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id k16si2838514edq.221.2019.09.09.08.52.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:52:00 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508660-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ILFAi3d3; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=szhe4Xk8; spf=pass (google.com: domain of gcc-patches-return-508660-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508660-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=tNeFJtLzek0wGEvNGlXVzbOpr5X8l ZAqs9hByNZ7WpcYTRP/s/hvivVkcftY5778zntRnorj21WqksOwubzPHqqvk5pqJ 7M7BNGjZ6hLrSS2VKEYt08bhEJtKlX4yNnUZR8shbGgWBe8UP0Plk2dY//MwdiGN +U8dmv4tatteCw= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=QUPymAHex8+xwmXT/kYEUEvCGCc=; b=ILF Ai3d3sP5+3izOQlQ+fturw0S2WA2PvS3lyRMv/RjFY02ArAxp1OkOF3ONFpulZgY avKct6GHOtxelnUu8oC+wI1yVfIsDbMQwnUnWANrXqYx8yDVTVXG3sGW1l+ZYdbu yE7CU7WVSRWHdEDA6E2x0JBX9n8QqzOE98vn77wc= Received: (qmail 8121 invoked by alias); 9 Sep 2019 15:51:46 -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 7990 invoked by uid 89); 9 Sep 2019 15:51:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:Wsugges, sk:wsugges X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:51:44 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpHtI007289 for ; Mon, 9 Sep 2019 17:51:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=v03MGAh9dunlD1jr7tJ7hiOjNO+/TXG8J+jJJLwu7pQ=; b=szhe4Xk8ZgA/7GRUmKQLBk2BhFeU0qySaYuNwFFW5wMXT2d/H+rOldZeo95j4ml1zk3E i79hntSyAsvZsMnpoOh+pFJ/TC4/1lamQT3sOi6RhDmFbB660//mrLke8mjiOuIAE7ee BmEtDXX/9U9W87viEjBAluROnbREhYewf4dQRGS5cDk5QkkLXPl7h3ssdjJ2k0BnPl6o UrxEDYFO+7n7qWIX8NHB59kUYUq6xoNtNR5aoDsFkvo1d+HL5VUTRCjYT6WZNHPTBCtQ rPZkaRWs9fnI+SM8aRgJYT9E5EmVrtyHdjOrCpTdgcfEXOBwQpkdFyK4Xri2uYim3z6N 9g== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa7197-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:51:41 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 899FF4B for ; Mon, 9 Sep 2019 15:51:37 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id BEA262B59EE for ; Mon, 9 Sep 2019 17:51:36 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:51:36 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 18/24] [ARM][testsuite] FDPIC: Enable tests on pie_enabled targets Date: Mon, 9 Sep 2019 17:45:00 +0200 Message-ID: <20190909154526.11630-19-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Some tests have the "nonpic" guard, but pass on arm*-*-uclinuxfdpiceabi because it is in PIE mode by default. Rather than adding this target to all these tests, add the "pie_enabled" effective target. 2019-XX-XX Christophe Lyon gcc/testsuite/ * g++.dg/cpp0x/noexcept03.C: Add pie_enabled. * g++.dg/ipa/devirt-c-7.C: Likewise. * g++.dg/ipa/ivinline-1.C: Likewise. * g++.dg/ipa/ivinline-2.C: Likewise. * g++.dg/ipa/ivinline-3.C: Likewise. * g++.dg/ipa/ivinline-4.C: Likewise. * g++.dg/ipa/ivinline-5.C: Likewise. * g++.dg/ipa/ivinline-7.C: Likewise. * g++.dg/ipa/ivinline-8.C: Likewise. * g++.dg/ipa/ivinline-9.C: Likewise. * g++.dg/tls/pr79288.C: Likewise. * gcc.dg/addr_equal-1.c: Likewise. * gcc.dg/const-1.c: Likewise. * gcc.dg/ipa/pure-const-1.c: Likewise. * gcc.dg/noreturn-8.c: Likewise. * gcc.dg/pr33826.c: Likewise. * gcc.dg/torture/ipa-pta-1.c: Likewise. * gcc.dg/tree-ssa/alias-2.c: Likewise. * gcc.dg/tree-ssa/ipa-split-5.c: Likewise. * gcc.dg/tree-ssa/loadpre6.c: Likewise. * gcc.dg/uninit-19.c: Likewise. Change-Id: I1a0d836b892c23891f739fccdc467d0f354ab82c -- 2.6.3 diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept03.C b/gcc/testsuite/g++.dg/cpp0x/noexcept03.C index 2d37867..906a44d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/noexcept03.C +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept03.C @@ -1,6 +1,6 @@ // Runtime test for noexcept-specification. // { dg-options "-Wnoexcept" } -// { dg-do run { target nonpic } } +// { dg-do run { target { nonpic || pie_enabled } } } // { dg-require-effective-target c++11 } #include diff --git a/gcc/testsuite/g++.dg/ipa/devirt-c-7.C b/gcc/testsuite/g++.dg/ipa/devirt-c-7.C index 2e76cbe..efb65c2 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-c-7.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-c-7.C @@ -1,7 +1,6 @@ /* Verify that ipa-cp will not get confused by placement new constructing an object within another one when looking for dynamic type change . */ -/* { dg-do run } */ -/* { dg-require-effective-target nonpic } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -Wno-attributes" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-1.C b/gcc/testsuite/g++.dg/ipa/ivinline-1.C index 9b10d20..2d988bc 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-1.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-1.C @@ -1,6 +1,6 @@ /* Verify that simple virtual calls are inlined even without early inlining. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-2.C b/gcc/testsuite/g++.dg/ipa/ivinline-2.C index 21cd46f..d978638 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-2.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-2.C @@ -1,6 +1,6 @@ /* Verify that simple virtual calls using this pointer are inlined even without early inlining.. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-3.C b/gcc/testsuite/g++.dg/ipa/ivinline-3.C index 1e24644..f756a16 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-3.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-3.C @@ -1,6 +1,6 @@ /* Verify that simple virtual calls on an object refrence are inlined even without early inlining. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-4.C b/gcc/testsuite/g++.dg/ipa/ivinline-4.C index cf0d980..5fbd3ef 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-4.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-4.C @@ -1,7 +1,7 @@ /* Verify that simple virtual calls are inlined even without early inlining, even when a typecast to an ancestor is involved along the way. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-5.C b/gcc/testsuite/g++.dg/ipa/ivinline-5.C index f15ebf2..6c19907 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-5.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-5.C @@ -1,6 +1,6 @@ /* Verify that virtual call inlining does not pick a wrong method when there is a user defined ancestor in an object. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-7.C b/gcc/testsuite/g++.dg/ipa/ivinline-7.C index a7b41e7..fd6aba6 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-7.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-7.C @@ -1,7 +1,7 @@ /* Verify that simple virtual calls are inlined even without early inlining, even when a typecast to an ancestor is involved along the way and that ancestor is not the first one with virtual functions. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-8.C b/gcc/testsuite/g++.dg/ipa/ivinline-8.C index 5c3299f..bc81abf 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-8.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-8.C @@ -1,6 +1,6 @@ /* Verify that virtual calls are inlined (ithout early inlining) even when their caller is itself indirectly inlined. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-9.C b/gcc/testsuite/g++.dg/ipa/ivinline-9.C index 41b2381..0917f15 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-9.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-9.C @@ -2,7 +2,7 @@ inlining, even when a typecast to an ancestor is involved along the way and that ancestor itself has an ancestor wich is not the primary base class. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/tls/pr79288.C b/gcc/testsuite/g++.dg/tls/pr79288.C index 9f488df..da6751f 100644 --- a/gcc/testsuite/g++.dg/tls/pr79288.C +++ b/gcc/testsuite/g++.dg/tls/pr79288.C @@ -1,5 +1,5 @@ // PR c++/79288 -// { dg-do compile { target nonpic } } +// { dg-do compile { target { nonpic || pie_enabled } } } // { dg-require-effective-target tls } // { dg-options "-O2" } // { dg-final { scan-assembler-not "@tpoff" { target i?86-*-* x86_64-*-* } } } diff --git a/gcc/testsuite/gcc.dg/addr_equal-1.c b/gcc/testsuite/gcc.dg/addr_equal-1.c index 18b0dc9..35fa010 100644 --- a/gcc/testsuite/gcc.dg/addr_equal-1.c +++ b/gcc/testsuite/gcc.dg/addr_equal-1.c @@ -1,5 +1,4 @@ -/* { dg-do run } */ -/* { dg-require-effective-target nonpic } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-require-weak "" } */ /* { dg-require-alias "" } */ /* { dg-options "-O2 -fdelete-null-pointer-checks" } */ diff --git a/gcc/testsuite/gcc.dg/const-1.c b/gcc/testsuite/gcc.dg/const-1.c index 2e95bd8..5c2d49d 100644 --- a/gcc/testsuite/gcc.dg/const-1.c +++ b/gcc/testsuite/gcc.dg/const-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2 -Wsuggest-attribute=const -fno-finite-loops" } */ extern int extern_const(int a) __attribute__ ((const)); diff --git a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c index 06b415e..dd58457 100644 --- a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c +++ b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const -fdump-tree-optimized -fno-early-inlining -fgnu89-inline" } */ void abort (void); int error_code; diff --git a/gcc/testsuite/gcc.dg/noreturn-8.c b/gcc/testsuite/gcc.dg/noreturn-8.c index 294800b..ce41cab 100644 --- a/gcc/testsuite/gcc.dg/noreturn-8.c +++ b/gcc/testsuite/gcc.dg/noreturn-8.c @@ -1,4 +1,4 @@ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2" } */ void exit (int); void noreturn_autodetection_failed (); diff --git a/gcc/testsuite/gcc.dg/pr33826.c b/gcc/testsuite/gcc.dg/pr33826.c index df83915..d222774 100644 --- a/gcc/testsuite/gcc.dg/pr33826.c +++ b/gcc/testsuite/gcc.dg/pr33826.c @@ -1,8 +1,7 @@ /* Regression test for PR middle-end/33826 */ /* Verify that recursive functions cannot be pure or const. */ -/* { dg-do compile } */ -/* { dg-require-effective-target nonpic } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O1 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const" } */ int recurse1 (int); diff --git a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c index 1bf4997..30156a3 100644 --- a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c +++ b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { nonpic } } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-fipa-pta -fdump-ipa-pta2 -fno-ipa-icf" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c index e10a25d..f9d2dd4 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { nonpic } } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ static int a; int f; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c index 2d713d6..3b5a94f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-tree-fnsplit -fdump-tree-optimized --param=builtin-expect-probability=100" } */ struct a {int a,b;}; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c index 028becd..b4e9296 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2 -fdump-tree-pre-stats -fdump-tree-fre1" } */ #include From patchwork Mon Sep 9 15:45:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173408 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4540866ilq; Mon, 9 Sep 2019 08:52:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNxdMwTOfhXkCYTksE7RLchCBck9T3RUt2XTpm4xiRw6A8kzKKOLk3+nAHbHUDnqzJTZi/ X-Received: by 2002:a17:906:3659:: with SMTP id r25mr4386622ejb.53.1568044336785; Mon, 09 Sep 2019 08:52:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044336; cv=none; d=google.com; s=arc-20160816; b=CfhhNCk3+7s9n/a+PaR0OK1IQxIySu2BkaxKeUz81VfE87fCHtcpM5TT3wlPgERcA4 bupbhoZieSwE8Xuv2FrkE0MYADYZz8Cbh7dfsObyzcsB6JNY1adYn9EfNumbiDAt3oaM NIXYGDm07hhyIvEe5r+B8mznst5RWEG3HMFFPEcNA2t8rW8GJn/rdIJMUueItRHaMcxd t6b0sF0EwASRg8UlM5P4FYj+AJTkj70MSkviPleYqPhxI5fWalsWVUWvwmHuenhDkwGL 1mFvzv1psMWH/PUw6pVQp13vIRYDa1S/D8CXiEcbd85WghCSdeEsDddGz2d6dl1BNRSi fsJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=dQRMLgAbo1vMy722l76MCjA0bw6FaldqVVCKZLG9wTA=; b=MvK/5f7J5jJlWUc10mhG0XQKCU54ZZwOlOQHhy/TBCatc3j/f2LahEOXHdKIypD7AE 6KpgmlfyLc5cFlGV4PQBkxx+DCkHSq7hcYkD52sspn+jxU3vF+DKaM27zYWnHAhL+tW0 4Z9872jT/s2m+Tqlo/S7WLfy58SiNVGkmLrpWfPwS1Bd62hHqeS5DJT1VDhoVUykzwqO 5cPZtEg+eJi8o3bv2Gd59UEJc+OD5BKh5ab9gBbp3L7M2+LntJ3kAH3xYmIoPLYe5uvb dPvaABbztAbHz2kRAbzAzUSaV8SGkk+7C8/tkV25dhGOU9UpYhebdyxlTBnzR2/PNBlB i/nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=qmpWmjz0; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=XKsoUxOT; spf=pass (google.com: domain of gcc-patches-return-508661-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508661-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q15si7629867eja.36.2019.09.09.08.52.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:52:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508661-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=qmpWmjz0; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=XKsoUxOT; spf=pass (google.com: domain of gcc-patches-return-508661-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508661-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=NvKWoB2tNRa6Aqbe0s18xY9hwEHZe HmF4yHd8ZM2p5qcYHApwugDuO2uIkQgH9FswZX6aE3L4iaIcORI2hXzTZl9RhC1R lm/RCVHt63uFfziHQqit6I60/EeczxV3snaMQUsWYFOnE+IMyMp+ZQZUhh5JwnHu bzcvCkxbJG1MxY= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=zvBazwAUnEE7NnlGQXb55aDbnto=; b=qmp Wmjz0iUJ73jY4kOJy2hproM9Z8dojV0miyVWgYWS5s0enJ8ffr1/AjB3cxxQj5Up sZynCf/rldv3Sm6CsPiYqmgm3yHxrVV6hk4lr7q5VqWPoSoIxHl1veM+2RdkMgQ9 2m32M1tBwSUDc2VG9A0mOX6bzTeOn0l+5YCPWqso= Received: (qmail 11130 invoked by alias); 9 Sep 2019 15:52:03 -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 11111 invoked by uid 89); 9 Sep 2019 15:52:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:52:02 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89Fovrx007207 for ; Mon, 9 Sep 2019 17:52:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=dQRMLgAbo1vMy722l76MCjA0bw6FaldqVVCKZLG9wTA=; b=XKsoUxOT9Ta1QDrpQy+ZcSWc56OlJaIa3mtE1erk2m2MGvj2w/04qCDHaSxy4jU1DJly dt/3uP3TZIHv8dDHFUVS8DH0irkJyTOazNLevN4V9gtZUqM3ovgyWwwircMzR7aKW4MR NREnrKAAAgHGgvL2NCBY5PXgSh5SGbs4X5OC36bjtlJfIe9PtHA20hg2KeJpAErHxFWD OLh2JZFYr5viIO6JdRIcRPqcYxzYWVbNAvexAM85IxFk+GFBDnAB/Acgjup1K7UApKM/ /24PVSXxzL6a/9XiBKI2FYGwMwkkjAVLI9qbhX7psnGCp747D5VYtc0qNMm/Dsy7w+MR Cg== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa71b4-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:52:00 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 84F6E23 for ; Mon, 9 Sep 2019 15:51:57 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id EA3EB2B0DEF for ; Mon, 9 Sep 2019 17:51:56 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:51:56 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 19/24] [ARM][testsuite] FDPIC: Adjust pr43698.c to avoid clash with uclibc. Date: Mon, 9 Sep 2019 17:45:01 +0200 Message-ID: <20190909154526.11630-20-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon uclibc defines bswap_32, so use a different name in this test. 2019-XX-XX Christophe Lyon gcc/testsuite/ * gcc.target/arm/pr43698.c (bswap_32): Rename as my_bswap_32. Change-Id: I2591bd911030814331cabf97ee5cf6cf8124b4f3 -- 2.6.3 diff --git a/gcc/testsuite/gcc.target/arm/pr43698.c b/gcc/testsuite/gcc.target/arm/pr43698.c index 1fc497c..3b5dad0 100644 --- a/gcc/testsuite/gcc.target/arm/pr43698.c +++ b/gcc/testsuite/gcc.target/arm/pr43698.c @@ -6,7 +6,7 @@ char do_reverse_endian = 0; -# define bswap_32(x) \ +# define my_bswap_32(x) \ ((((x) & 0xff000000) >> 24) | \ (((x) & 0x00ff0000) >> 8) | \ (((x) & 0x0000ff00) << 8) | \ @@ -16,7 +16,7 @@ char do_reverse_endian = 0; (__extension__ ({ \ uint64_t __res; \ if (!do_reverse_endian) { __res = (X); \ - } else if (sizeof(X) == 4) { __res = bswap_32((X)); \ + } else if (sizeof(X) == 4) { __res = my_bswap_32((X)); \ } \ __res; \ })) From patchwork Mon Sep 9 15:45:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173409 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4541317ilq; Mon, 9 Sep 2019 08:52:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKbfhqDSV5ZA3PXNu8Hqwm4wwu8TXg5Tkv1hetPM2DbHgmxDjcW//3wlX1miwToWUc+ZOb X-Received: by 2002:aa7:dac5:: with SMTP id x5mr25348362eds.290.1568044362366; Mon, 09 Sep 2019 08:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044362; cv=none; d=google.com; s=arc-20160816; b=bE6JXOrLDeTyFSyLqbLlJ16+XyiQ/fdPOsValtp9/Z+pi1gunj9LSrGyuWFEekrke7 B5pjxr+D4DKLgCSCPu7T//OmYRQXrGGuHc7+TYNmHzxKGpp9I9n/vsZer03lVhA3glDi LK5vOsSeqVe/mqNBvS/hsJxTOlYKzkIK0Uww+WNA5VlGTbH/OHN2ihn5hmUqaHJYias/ M1IQUU+1YpPlJs5kSpQIWYdXWUQoZqfUJgT7U7V4Dg4jGiG3UysJMFWgowS/wIMC4WE2 QbbZrxwlrjC/yYl0zrEv7naJ60Gmg8ZZhOaKtIvGOwuWkq5920/d704WfeJ5WHbaxPKV 5QUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=TVz4O9yPFS6es5/RfFVWRa2RR2SzUGbP5DdeZYJkoUM=; b=Yvzs5/ttuEH4EJEFstZrAQZd8uQtsJcLlIh2mLImo6z45aBXsn3esNOB8yXSwmEJDJ 11dkpbP5op1IqfDmlZUQqQPunOIK6OIjKonzjWYNehx0d9Stcva51E5lIBuwafv8+Odj oiCeUt+Az4qiYcVwDbCyRBMmX4X5kqZEXf+XVw1+/9MTWsQeBfE++T5KOUIlBMvHsdao vHWkYsY2YRdd2vOaTQfI3YA1xptV1USLpotpDllitI+oifAVv9Z3CDpinT/yLBOb/WTH Lh6V3T2ijwRNJ/d2klOi17roEV/n5/78r6aQXFAX6SqJ14ghwJ+11H6vgEIrXinBFYNA 5DsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=htDUZRoL; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="VgDuK/QI"; spf=pass (google.com: domain of gcc-patches-return-508663-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508663-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z11si4203338ejm.28.2019.09.09.08.52.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508663-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=htDUZRoL; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="VgDuK/QI"; spf=pass (google.com: domain of gcc-patches-return-508663-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508663-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=HT9TAoYrkT6KTPnanQxi5OZpXhFRY i705GwFYpgw/pi/sHEJ/TitVi3jUWqMEg+wtRiSMrEQI7WYQZkFRFL5gZzCvb/d4 Fx1fXYrKXIjkRv2CKJDJl3Yag+kb3ZMiD2QjrRI22CE2OQk3+G3y/2eDjs1WLk7F ZtJadNoAa/n2kc= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=c7Yt82sxlCVF0oXjGdmDlcbkKLU=; b=htD UZRoLAjF0h8c8Ye8PiOk/k7/BTjIRYScFoygc52UqApnqeKmg9pHBNcXDMqlpFf3 YaPghpjGQ92ayuPE7ssU+fYU/llEwGwFPoDi6mi4//Q0IODfjfX3oAutVJ0A0gcv ekQOPfF0JLrgSfWt6uHsRAniFt3/+4CjHLepXVs4= Received: (qmail 14009 invoked by alias); 9 Sep 2019 15:52:28 -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 14001 invoked by uid 89); 9 Sep 2019 15:52:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:52:23 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpQZa005679 for ; Mon, 9 Sep 2019 17:52:21 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=TVz4O9yPFS6es5/RfFVWRa2RR2SzUGbP5DdeZYJkoUM=; b=VgDuK/QITz3Y2YlQcY7eCUnXZ13cE0vQaxcQU4Lic98B8c19QZXc+IZIpPY7iFrzcmQE 48s4PoOF+myj8t3aoEen6lQ04Zsxpscrz5TYf1p/Z1bg6PAaGyIOgnpi+Io+9t+CQvlP YcN3e5OP8vR6tuwslPgaprMpYua+h/865OUS8EgZ9sa5AFSVky24RO7jRvdRmJ5ERC4d zvDT9LXHxTFQe7wUA48urwNmF9tONHOX7NLjZTfwW9hdofCjndrGouMKV0UoVKz05jEP gBo7MncX0MyDucmSn1qk64n5QpXZXBg1M3v3ycuDt4i4aI6AexpW6icDVaefVrZJBsXA nA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv2avxhyb-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:52:21 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id B790A23 for ; Mon, 9 Sep 2019 15:52:17 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 2BF5E2B5A0F for ; Mon, 9 Sep 2019 17:52:17 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:52:16 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 20/24] [ARM][testsuite] FDPIC: Skip tests using architectures unsupported by FDPIC Date: Mon, 9 Sep 2019 17:45:02 +0200 Message-ID: <20190909154526.11630-21-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Since FDPIC currently supports arm and thumb-2 modes only, these tests fail because they enforce an architecture version that doesn't match these restrictions. This patch introduces new values for the arm_arch effective-target (v4t_thumb, v5t_thumb, v5te_thumb, v6_thumb, v6k_thumb, v6z_thumb) as needed, and adds them to the relevant tests. In addition, it adds v4t_arm, v5t_arm, v5te_arm, v6_arm, v6k_arm and v6z_arm to avoid skipping some tests when GCC is configured to generate Thumb code by default. It also adds the corresponding non-thumb effective-target to the tests that were missing it. The existing v4t, v5t, v5te, v6 v6k and v6z effective-targets now force -mfloat-abi=softfp since these thumb-1 targets do not support hard-float anyway. Finally, the patch removes the special case to detect the presence of -marm in the flags, since it makes atomic_loaddi tests unsupported: since the flags in question also include -march, the combination is supported, while -marm alone is not if GCC is configured to target an M-profile CPU. 2019-XX-XX Christophe Lyon gcc/testsuite/ * lib/target-supports.exp (check_effective_target_arm_arch_FUNC_ok): Add v4t_arm, v4t_thumb, v5t_arm, v5t_thumb, v5te_arm, v5te_thumb, v6_arm, v6_thumb, v6k_arm, v6k_thumb, v6z_arm, v6z_thumb. Add -mfloat-abi=softfp to v4t, v5t, v5te, v6, v6k, v6z. Remove early exit for -marm. * gcc.target/arm/armv6-unaligned-load-ice.c: Add arm_arch effective-target. * gcc.target/arm/attr-unaligned-load-ice.c: Likewise. * gcc.target/arm/ftest-armv4-arm.c: Likewise. * gcc.target/arm/ftest-armv4t-arm.c: Likewise. * gcc.target/arm/ftest-armv4t-thumb.c: Likewise. * gcc.target/arm/ftest-armv5t-arm.c: Likewise. * gcc.target/arm/ftest-armv5t-thumb.c: Likewise. * gcc.target/arm/ftest-armv5te-arm.c: Likewise. * gcc.target/arm/ftest-armv5te-thumb.c: Likewise. * gcc.target/arm/ftest-armv6-arm.c: Likewise. * gcc.target/arm/ftest-armv6-thumb.c: Likewise. * gcc.target/arm/ftest-armv6k-arm.c: Likewise. * gcc.target/arm/ftest-armv6k-thumb.c: Likewise. * gcc.target/arm/ftest-armv6m-thumb.c: Likewise. * gcc.target/arm/ftest-armv6t2-arm.c: Likewise. * gcc.target/arm/ftest-armv6t2-thumb.c: Likewise. * gcc.target/arm/ftest-armv6z-arm.c: Likewise. * gcc.target/arm/ftest-armv6z-thumb.c: Likewise. * gcc.target/arm/g2.c: Likewise. * gcc.target/arm/macro_defs1.c: Likewise. * gcc.target/arm/pr59858.c: Likewise. * gcc.target/arm/pr65647-2.c: Likewise. * gcc.target/arm/pr79058.c: Likewise. * gcc.target/arm/pr83712.c: Likewise. * gcc.target/arm/pragma_arch_switch_2.c: Likewise. * gcc.target/arm/scd42-1.c: Likewise. * gcc.target/arm/scd42-2.c: Likewise. * gcc.target/arm/scd42-3.c: Likewise. * gcc.c-torture/compile/pr82096.c: Fix arm_arch effective-target. * gcc.target/arm/attr_arm-err.c: Likewise. * gcc.target/arm/di-longlong64-sync-withldrexd.c: Likewise. Change-Id: I0845b262b241026561cc52a19ff8bb1659675e49 -- 2.6.3 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr82096.c b/gcc/testsuite/gcc.c-torture/compile/pr82096.c index d144b70..4e695cd 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr82096.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr82096.c @@ -1,4 +1,4 @@ -/* { dg-require-effective-target arm_arch_v5t_ok { target arm*-*-* } } */ +/* { dg-require-effective-target arm_arch_v5t_thumb_ok { target arm*-*-* } } */ /* { dg-skip-if "Do not combine float-abi values" { arm*-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ /* { dg-additional-options "-march=armv5t -mthumb -mfloat-abi=soft" { target arm*-*-* } } */ diff --git a/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c b/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c index 88528f1..886a012 100644 --- a/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c +++ b/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6k" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6k_thumb_ok } */ /* { dg-options "-mthumb -Os -mfloat-abi=softfp" } */ /* { dg-add-options arm_arch_v6k } */ diff --git a/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c b/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c index e1ed1c1..2eeb522 100644 --- a/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c +++ b/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c @@ -2,6 +2,7 @@ Verify that unaligned_access is correctly with attribute target. */ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6" } } */ +/* { dg-require-effective-target arm_arch_v6_ok } */ /* { dg-options "-Os -mfloat-abi=softfp -mtp=soft" } */ /* { dg-add-options arm_arch_v6 } */ diff --git a/gcc/testsuite/gcc.target/arm/attr_arm-err.c b/gcc/testsuite/gcc.target/arm/attr_arm-err.c index 630c06a..67d572a 100644 --- a/gcc/testsuite/gcc.target/arm/attr_arm-err.c +++ b/gcc/testsuite/gcc.target/arm/attr_arm-err.c @@ -1,7 +1,7 @@ /* Check that attribute target arm is rejected for M profile. */ /* { dg-do compile } */ -/* { dg-require-effective-target arm_arm_ok } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ +/* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-add-options arm_arch_v6m } */ int __attribute__((target("arm"))) diff --git a/gcc/testsuite/gcc.target/arm/di-longlong64-sync-withldrexd.c b/gcc/testsuite/gcc.target/arm/di-longlong64-sync-withldrexd.c index 517c4a8..befb7ec 100644 --- a/gcc/testsuite/gcc.target/arm/di-longlong64-sync-withldrexd.c +++ b/gcc/testsuite/gcc.target/arm/di-longlong64-sync-withldrexd.c @@ -1,7 +1,6 @@ /* { dg-do compile } */ -/* { dg-require-effective-target arm_arm_ok } */ /* { dg-options "-marm -std=gnu99" } */ -/* { dg-require-effective-target arm_arch_v6k_ok } */ +/* { dg-require-effective-target arm_arch_v6k_arm_ok } */ /* { dg-add-options arm_arch_v6k } */ /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */ /* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c index 4b48ef8..447a8ec 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v4_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v4 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c index 016506f..28fd2f7 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v4t_arm_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v4t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c index 9ef944e..78878f7 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v4t_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v4t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c index a9403e9..8191299 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5t_arm_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v5t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c index f3ad07e..b25d17d 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5t_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v5t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c index f98c01a..e0c0d5c 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5te" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_arm_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v5te } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c index 5d71787..27a64a2 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5te" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v5te } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c index 88a5089..5d447c3 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6_arm_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c index 90ef9d2..15a6d75 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c index 8de021a..0656e8f 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6k" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6k_arm_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6k } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c index c2fc270..b3b6ecf 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6k" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6k_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6k } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c index ee075e2..27f71be 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6m } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c index 83b4bc4..259d2b5 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6t2" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6t2_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6t2 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c index 1a1cbc5..e624ec5 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6t2" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6t2_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6t2 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c index e2df0d4..6e3a966 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6z" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6z_arm_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6z } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c index e4b94ef..23a4fcd 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6z" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6z_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6z } */ diff --git a/gcc/testsuite/gcc.target/arm/g2.c b/gcc/testsuite/gcc.target/arm/g2.c index e368017..ca5e3cc 100644 --- a/gcc/testsuite/gcc.target/arm/g2.c +++ b/gcc/testsuite/gcc.target/arm/g2.c @@ -4,6 +4,7 @@ /* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */ /* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "Test is specific to ARM mode" { arm*-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_arm_ok } */ /* { dg-require-effective-target arm32 } */ /* Brett Gaines' test case. */ diff --git a/gcc/testsuite/gcc.target/arm/macro_defs1.c b/gcc/testsuite/gcc.target/arm/macro_defs1.c index 4cc9ae6..655ba93 100644 --- a/gcc/testsuite/gcc.target/arm/macro_defs1.c +++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-options "-march=armv6-m -mthumb" } */ #ifdef __ARM_NEON_FP diff --git a/gcc/testsuite/gcc.target/arm/pr59858.c b/gcc/testsuite/gcc.target/arm/pr59858.c index a944b9a..bcfd5d5 100644 --- a/gcc/testsuite/gcc.target/arm/pr59858.c +++ b/gcc/testsuite/gcc.target/arm/pr59858.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-march=armv5te -fno-builtin -mfloat-abi=soft -mthumb -fno-stack-protector -Os -fno-tree-loop-optimize -fno-tree-dominator-opts -fPIC -w" } */ /* { dg-skip-if "Incompatible command line options: -mfloat-abi=soft -mfloat-abi=hard" { *-*-* } { "-mfloat-abi=hard" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_thumb_ok } */ typedef enum { REG_ENOSYS = -1, diff --git a/gcc/testsuite/gcc.target/arm/pr65647-2.c b/gcc/testsuite/gcc.target/arm/pr65647-2.c index f2985f8..e3978e5 100644 --- a/gcc/testsuite/gcc.target/arm/pr65647-2.c +++ b/gcc/testsuite/gcc.target/arm/pr65647-2.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target arm_arch_v6_arm_ok } */ /* { dg-options "-O3 -marm -march=armv6 -std=c99" } */ typedef struct { diff --git a/gcc/testsuite/gcc.target/arm/pr79058.c b/gcc/testsuite/gcc.target/arm/pr79058.c index 54a1d8a..7d078ac 100644 --- a/gcc/testsuite/gcc.target/arm/pr79058.c +++ b/gcc/testsuite/gcc.target/arm/pr79058.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_arm_ok } */ +/* { dg-require-effective-target arm_arch_v4_ok } */ /* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" } { "-mcpu=arm7tdmi" } } */ /* { dg-options "-Os -mbig-endian -marm -mcpu=arm7tdmi" } */ diff --git a/gcc/testsuite/gcc.target/arm/pr83712.c b/gcc/testsuite/gcc.target/arm/pr83712.c index 8ed8cdf..4902ec9 100644 --- a/gcc/testsuite/gcc.target/arm/pr83712.c +++ b/gcc/testsuite/gcc.target/arm/pr83712.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target arm_arch_v5t_thumb_ok } */ /* { dg-options "-mfloat-abi=softfp -mthumb -march=armv5t -O2" } */ #pragma GCC optimize ("-O2") diff --git a/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c b/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c index b6211f9..5080d2c 100644 --- a/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c +++ b/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c @@ -2,6 +2,7 @@ /* { dg-skip-if "instruction not valid on thumb" { *-*-* } { "-mthumb" } { "" } } */ /* { dg-do assemble } */ /* { dg-require-effective-target arm_arm_ok } */ +/* { dg-require-effective-target arm_arch_v5te_arm_ok } */ /* { dg-additional-options "-Wall -O2 -march=armv5te -std=gnu99 -marm" } */ #pragma GCC target ("arch=armv6") diff --git a/gcc/testsuite/gcc.target/arm/scd42-1.c b/gcc/testsuite/gcc.target/arm/scd42-1.c index be60e64..2b8fc0b 100644 --- a/gcc/testsuite/gcc.target/arm/scd42-1.c +++ b/gcc/testsuite/gcc.target/arm/scd42-1.c @@ -3,6 +3,7 @@ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-options "-mcpu=xscale -O -mfloat-abi=softfp" } */ unsigned load1(void) __attribute__ ((naked)); diff --git a/gcc/testsuite/gcc.target/arm/scd42-2.c b/gcc/testsuite/gcc.target/arm/scd42-2.c index 6d9e5e1..3c9768d 100644 --- a/gcc/testsuite/gcc.target/arm/scd42-2.c +++ b/gcc/testsuite/gcc.target/arm/scd42-2.c @@ -4,6 +4,7 @@ /* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "Test is specific to ARM mode" { arm*-*-* } { "-mthumb" } { "" } } */ /* { dg-require-effective-target arm32 } */ +/* { dg-require-effective-target arm_arch_v5te_arm_ok } */ /* { dg-options "-mcpu=xscale -O -marm" } */ unsigned load2(void) __attribute__ ((naked)); diff --git a/gcc/testsuite/gcc.target/arm/scd42-3.c b/gcc/testsuite/gcc.target/arm/scd42-3.c index e566cb2..0afd121 100644 --- a/gcc/testsuite/gcc.target/arm/scd42-3.c +++ b/gcc/testsuite/gcc.target/arm/scd42-3.c @@ -3,6 +3,7 @@ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-options "-mcpu=xscale -O -mfloat-abi=softfp" } */ unsigned load4(void) __attribute__ ((naked)); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 0b67e10..1a1eed8 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -4181,13 +4181,25 @@ proc check_effective_target_arm_fp16_hw { } { # /* { dg-require-effective-target arm_arch_v5t_multilib } */ foreach { armfunc armflag armdefs } { v4 "-march=armv4 -marm" __ARM_ARCH_4__ - v4t "-march=armv4t" __ARM_ARCH_4T__ - v5t "-march=armv5t" __ARM_ARCH_5T__ - v5te "-march=armv5te" __ARM_ARCH_5TE__ - v6 "-march=armv6" __ARM_ARCH_6__ - v6k "-march=armv6k" __ARM_ARCH_6K__ + v4t "-march=armv4t -mfloat-abi=softfp" __ARM_ARCH_4T__ + v4t_arm "-march=armv4t -marm" __ARM_ARCH_4T__ + v4t_thumb "-march=armv4t -mthumb -mfloat-abi=softfp" __ARM_ARCH_4T__ + v5t "-march=armv5t -mfloat-abi=softfp" __ARM_ARCH_5T__ + v5t_arm "-march=armv5t -marm" __ARM_ARCH_5T__ + v5t_thumb "-march=armv5t -mthumb -mfloat-abi=softfp" __ARM_ARCH_5T__ + v5te "-march=armv5te -mfloat-abi=softfp" __ARM_ARCH_5TE__ + v5te_arm "-march=armv5te -marm" __ARM_ARCH_5TE__ + v5te_thumb "-march=armv5te -mthumb -mfloat-abi=softfp" __ARM_ARCH_5TE__ + v6 "-march=armv6 -mfloat-abi=softfp" __ARM_ARCH_6__ + v6_arm "-march=armv6 -marm" __ARM_ARCH_6__ + v6_thumb "-march=armv6 -mthumb -mfloat-abi=softfp" __ARM_ARCH_6__ + v6k "-march=armv6k -mfloat-abi=softfp" __ARM_ARCH_6K__ + v6k_arm "-march=armv6k -marm" __ARM_ARCH_6K__ + v6k_thumb "-march=armv6k -mthumb -mfloat-abi=softfp" __ARM_ARCH_6K__ v6t2 "-march=armv6t2" __ARM_ARCH_6T2__ - v6z "-march=armv6z" __ARM_ARCH_6Z__ + v6z "-march=armv6z -mfloat-abi=softfp" __ARM_ARCH_6Z__ + v6z_arm "-march=armv6z -marm" __ARM_ARCH_6Z__ + v6z_thumb "-march=armv6z -mthumb -mfloat-abi=softfp" __ARM_ARCH_6Z__ v6m "-march=armv6-m -mthumb -mfloat-abi=soft" __ARM_ARCH_6M__ v7a "-march=armv7-a" __ARM_ARCH_7A__ v7r "-march=armv7-r" __ARM_ARCH_7R__ @@ -4204,10 +4216,6 @@ foreach { armfunc armflag armdefs } { v8r "-march=armv8-r" __ARM_ARCH_8R__ } { eval [string map [list FUNC $armfunc FLAG $armflag DEFS $armdefs ] { proc check_effective_target_arm_arch_FUNC_ok { } { - if { [ string match "*-marm*" "FLAG" ] && - ![check_effective_target_arm_arm_ok] } { - return 0 - } return [check_no_compiler_messages arm_arch_FUNC_ok assembly { #if !(DEFS) #error !(DEFS) From patchwork Mon Sep 9 15:45:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173410 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4541620ilq; Mon, 9 Sep 2019 08:53:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqysYuoZP3b5o8hwsp+is8jcPcLd+CqYX+r/PCzaxdAbqicY7+hXfHna0l0zEZ1lKJgk+01k X-Received: by 2002:a17:906:770d:: with SMTP id q13mr15056051ejm.260.1568044380497; Mon, 09 Sep 2019 08:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044380; cv=none; d=google.com; s=arc-20160816; b=An4MtGduY8tks7WXyxnDUr4IF+PN73IxvqArdQaWK/TiZ/FDfgWEeLRL6dWpAMSpOP 3J2Rd3rqqy57zeIBZQP1iEBAIikuFhht4jUHUD9yz7r3EQjy5y3/yN/imXW1T+CUfZ2U 6tKi+7kteapjeAdb67MGg9lvfo48aLckUR3QvBbCUWMOTkdBI44GZT/g4beTy6eimnQW Gxi1HF20Nhv+Qa+pH5dJ2LBlXZlsc8MYmsgEp4DDX2wTAjXpajlmihE0fBWxaG5JCtcE wydUEWfZ7sWHUk3DiRQd7SVtNvztZV538rsJswdtiCRuIzIqrD/IuFdorFyipUV2IH9f x3mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=s8gMizsfcaRYbJor83rbYF1yUMEEU/FD4/NHXhPGA5E=; b=yGojMvd19ppG099Ym5CjlxY55Pu3cL0EkCKJqo5wUxly7lFgLEJ78/fEAHyqpCc0GU Le8AhvwIar61Jhlzh0Vkql5pQzzbX5hloOfhqw9MfkU05l974QbL1u22W4VtgeAz6lur UCVBvdwhCzic7+sJK2441m05ugDB9WFt+njC5zIFUiC0TIWh8oP2GBgmHlZ2WPHcXPCy Dv5xy5Vnemhlmz3m/umkhHkYQ9kygT3HmbE0PvX47XiloaTh99JEIAr2BSGWz6aNKZ7U D8M6TuszMwn3ZIucNay3isUt75bwMXe0mkN5N0DWfuClJZKm8Sq9NQx025xBOSMrsmDm GOPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Dg0G8DxP; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=nJWkYjsn; spf=pass (google.com: domain of gcc-patches-return-508664-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508664-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w17si7489367ejf.362.2019.09.09.08.52.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:53:00 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508664-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Dg0G8DxP; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=nJWkYjsn; spf=pass (google.com: domain of gcc-patches-return-508664-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508664-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=diuzE1A4m4mG06hK9PcgWW9fthGlS fzrvJXJKEsktO6WVtkCUYjQjM7DI1f86jZnv6HTKuy1HZQ5Q3vvlZO0biV4x6sAu hJxTo3q43L1Y1IjEa9VbMx233+8Js5RkVG1Cwuezr6pfxSSD8dOt67VgAnUuNCCm Ua/D/U/YtTxHx8= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=3UDFXV9pbbMnwGZHEj7qzPcPMBU=; b=Dg0 G8DxPGqR68jLpgbBsPoJu3T55plvoUWQr5jTiNJ3m9vH6T2c+awITarTEImnFk92 sFEq77xX+HyRoOH70T1r1xDMsCmF/Ko/YbybpIS57XCRIB8MwskcHxdnjAoyauuK ahFLcEdU+pFUXzapxoPKZ9cO1WHedmm197rlZCFo= Received: (qmail 15722 invoked by alias); 9 Sep 2019 15:52:45 -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 15695 invoked by uid 89); 9 Sep 2019 15:52:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=Forces X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:52:43 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpDVT005008 for ; Mon, 9 Sep 2019 17:52:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=s8gMizsfcaRYbJor83rbYF1yUMEEU/FD4/NHXhPGA5E=; b=nJWkYjsngi+8iD49Can17VlhjLgIFhkfnrg90+CN1FunjweNAqrkhFZZEfIQo0dmAd2w ZfKy4WKBo6FDmtjMuwU46pSdgFPdFdQfoJeeBfQRvJNf0tEFB4zqmiCytPdTQuye5XjO Z3R6A81mvR0/ePY9zmLuG3sxB4+XlDuc2riGGSKFR8bXyUnfcuaYPrwri9wITicDOIAw mR+jcTKSh9+pFahAxyBIQ5CP8pZU/0ySVU060zEoT40RrIhqNjE15mwVIFVZrS8fWW+E ZpzmpH2J4DfO6V8hUXCb6OYtTeouFgdSc9AC7n06AP7hMGnDVSYRIlAI3L8HArwFryRX 0w== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212em2u-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:52:41 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id EB42624 for ; Mon, 9 Sep 2019 15:52:37 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 60A432B0DEF for ; Mon, 9 Sep 2019 17:52:37 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:52:37 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 21/24] [ARM] FDPIC: Handle stack-protector combined patterns Date: Mon, 9 Sep 2019 17:45:03 +0200 Message-ID: <20190909154526.11630-22-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon The recent stack_protect_combined_set_insn and stack_protect_combined_test_insn force recomputing of GOT base, but need to take into account that in FDPIC mode, the PIC register is fixed by the ABI (r9). 2019-XX-XX Christophe Lyon gcc/ * config/arm/arm.md (stack_protect_combined_set_insn): Handle FDPIC mode. (stack_protect_combined_test_insn): Likewise. Change-Id: I0e47cf30cfe0dc401f43bd728aaae07bffa4c9cc -- 2.6.3 diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 918271d..6513c2d 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -8270,8 +8270,15 @@ { if (flag_pic) { + rtx pic_reg; + + if (TARGET_FDPIC) + pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + else + pic_reg = operands[3]; + /* Forces recomputing of GOT base now. */ - legitimize_pic_address (operands[1], SImode, operands[2], operands[3], + legitimize_pic_address (operands[1], SImode, operands[2], pic_reg, true /*compute_now*/); } else @@ -8346,8 +8353,15 @@ if (flag_pic) { + rtx pic_reg; + + if (TARGET_FDPIC) + pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + else + pic_reg = operands[4]; + /* Forces recomputing of GOT base now. */ - legitimize_pic_address (operands[1], SImode, operands[3], operands[4], + legitimize_pic_address (operands[1], SImode, operands[3], pic_reg, true /*compute_now*/); } else From patchwork Mon Sep 9 15:45:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173411 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4542023ilq; Mon, 9 Sep 2019 08:53:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzw2807OLwFECt7JYnOCScN2U70upYaCsXxEIL1xHJszSUWdLsd0Vsr5dURn7mAPce4JYfm X-Received: by 2002:a17:906:7e44:: with SMTP id z4mr19946839ejr.290.1568044400786; Mon, 09 Sep 2019 08:53:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044400; cv=none; d=google.com; s=arc-20160816; b=e2EAzPXmFVLolTES/wbehgH/irJWBSnZUwaDya7UHIyaW3RUpYt/FSBOug1TJnfpZ6 EOG44KlJxDaOD4wXF9xtK2X+uchx9l+wmp9E7cBi8L83GmLYuLUP9OFjLb96jN0QYui7 JG3DDR0DgXD5otsranqFQHn1c8pBUkm4f/SVt4NC9xyV5yD/UaRkV2iODOPt6shaLfHi uHPzS4WGqDJWcqsqZz0HIpYIC28JTM7jG73NhsjrP6UbR4qf1rzsnyO2iXJQd03T1th+ xrcGREktAARxdMCynuUXf0XuYvKL4SGO90uoSPh7ew4fX9MNxn2ax4WWDtL43Jstd2fF CiGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=xaotAcinz/jIDzJ2HqR9WGWqWDATad+Q9gId6hsvh6o=; b=eh4CxI78l+16PvKtHt4Ne5sWK1kI0NhB2RVt2iylc4HjO1+lt4adK+zWkY8HmNbGt8 nDp96YhA7tbdwUvRc6R/zFzzoR+UDbuAgnN9KLSTzM72wjwMMywgclFf58dTU4GUoyBt B63fPujb1Cw6IDJ56KiQlgX6GIthq66wX5KpT5Kpl/flvR0waPiTbzn6JLDpK7MTETml 6RZrNtfmOeMozMhilow0gGK/MLX5jsfALq3ytS1LWozkUIYKYUo5JENt18mplRX0ZnDg uYi9VWt+PgQb2d/GYI3Fh20YbaFQEjeDHg40hJpj2l5mip6ar8X6UBbbwD0mmF1Bbut0 fGMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=NHdDf0D5; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=Um8RPSnX; spf=pass (google.com: domain of gcc-patches-return-508665-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508665-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id n4si7568456edy.227.2019.09.09.08.53.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:53:20 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508665-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=NHdDf0D5; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=Um8RPSnX; spf=pass (google.com: domain of gcc-patches-return-508665-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508665-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=vfT6GTi7jmqwxSDzgqKOO/wgPL62k cprUJwBzSMlyWp7wUpg/SBkiRd/i9+SYSdDSrOeVCYpjOntBIVxmaz8HUBsCT5Eu 6BLQ0iTU/DvY4I1GmWdxL9tr+mtEeL7KxxgyyAlzPWDv2LFlUbAWoNo7GxFE8J3b tY/PpdjbMIKRB8= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=tRqNe32T51muKip8m/8qJBhPySM=; b=NHd Df0D5oEwXOCRuXEl+ISUfMUNqnw6YWOLJPxnx8GmIb0t4z87//FZsRrh/Se57ck2 zi4ZL2HhElqlPbtUGbY6pGCVQneZiwtm4SHuJ+Ts9uqYarXEp8NCW8cPBpZmmeNd eMbNe0pu9TDSzoDXqNDLAidfznWoIbXhB+CLvBqQ= Received: (qmail 17299 invoked by alias); 9 Sep 2019 15:53:08 -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 17291 invoked by uid 89); 9 Sep 2019 15:53:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:950 X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:53:07 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpDKE005011 for ; Mon, 9 Sep 2019 17:53:05 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=xaotAcinz/jIDzJ2HqR9WGWqWDATad+Q9gId6hsvh6o=; b=Um8RPSnXu68c7e9l97KHoeEk+6MlROuXr1f9j0lRHCON/1QgBftl0wZ/jBWAPvCsqeKu ZhOqHXvALbJjf0l7tA3daGQR+1SpOg8v9LiqdsTetN3wlS5+3LHa662brDuzjFhcPqp7 6UDHudO2/mHJC4vxg3yr+rlrlDWIp5lPGijZQ4n1dDWFAF84UTBIaY6cW98voxgcGY+B 0xRyifnx91KswGmIbYENYhcuCvCeIM0W/1L+uWgd5HVtpImHRub0u9nrKJPMgL/x4lK4 xYa32Yl0FelfFRyRK8hCrxG0oF934p0zHgMAr/LAb3fCP+m1r8CuMA52ySvxC4HVXtvO +w== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212em54-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:53:05 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 2D32A24 for ; Mon, 9 Sep 2019 15:53:02 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 849E82B2E76 for ; Mon, 9 Sep 2019 17:52:57 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:52:57 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 22/24] [ARM][testsuite] FDPIC: Skip tests that require -static support Date: Mon, 9 Sep 2019 17:45:04 +0200 Message-ID: <20190909154526.11630-23-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon Since FDPIC does not support -static, skip the related tests. 2019-XX-XX Christophe Lyon gcc/testsuite/ * lib/target-supports.exp (check_effective_target_static): Disable for ARM FDPIC target. Change-Id: I119d0541e53f2f1e531540b20e7bc47d8338d89a -- 2.6.3 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 1a1eed8..19899ce 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1083,6 +1083,9 @@ proc check_effective_target_pe_aligned_commons {} { # Return 1 if the target supports -static proc check_effective_target_static {} { + if { [istarget arm*-*-uclinuxfdpiceabi] } { + return 0; + } return [check_no_compiler_messages static executable { int main (void) { return 0; } } "-static"] From patchwork Mon Sep 9 15:45:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173412 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4542350ilq; Mon, 9 Sep 2019 08:53:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6MguYilEsQcO4qgGN6968b5JBrFbLodF6gRgqdMSt2rYGuDso2/MNNPIP7/XZJJQ6U32W X-Received: by 2002:a50:8dcb:: with SMTP id s11mr918266edh.27.1568044422224; Mon, 09 Sep 2019 08:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044422; cv=none; d=google.com; s=arc-20160816; b=VMOzMoI9p0j6ZSPYQaeCoH1igPbMqSy1sj0Zbg+B15deELisa/TtA79hPROSU+tycu 7iGj6i2T+4FlXHVcZ4j51vF5p2Mb0rXXDgTRFUSl9qezymZS/oEyrAdq+2kqxl2Hoy2Y rNSa4fDukSjpdmSJHQUHaJCd2T076p9y63D/ksBNlUovWr/arnKguV7lKTRbREPUY9X/ LElEYu5aHXEkzMaHZ29bl/2oXw4b/EZmfA+PZpHrkTrflHPcA38x522NX5F2TFD6SY0U lriowWCbZfc8efuhpRe3k/oCmpfxehYBoPRJRV2BxA+35IujNMraQY2BfWmgxAF8+lKn mcRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=SOkjjfACemC2p0XY5xL48RW5iBDf61PzVXxG+ERhVfM=; b=njA2+Fwl3oM/764APcN9F2yuQt4qbTgTUB/pzpdNBr0A3Q5hd6ZkfhqyHMFCsH+A3A eEqm3zIMb1HY7RgNMJGO7FQHXjMubfhycvWoHSx4Kj9R/C3+BfU4MMh8u1Yeiqpw4hAm hNRI18yvDNL6DQbouH6zrn3mjUr+zS3zwRb5antGfLeBf8ULYeBmjVAI3rNgGEivksVe wkvSgAshy4M7BD5UQ6zodBMZIenSsv83HhCdni4hVkX7yTZMAL0Wiuv3bgEZJuzEgMbM SByMw5iHQUIasjyVI4GLVZJoRQEQm8ksOUZe61RFs62MBL9bSmd/BUs7zlVXUbchA9uG l9+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="rLp2/G2e"; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=H8nnBptv; spf=pass (google.com: domain of gcc-patches-return-508666-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508666-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 5si1698596edy.95.2019.09.09.08.53.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:53:42 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508666-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="rLp2/G2e"; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=H8nnBptv; spf=pass (google.com: domain of gcc-patches-return-508666-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508666-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=GzmnAPmNSimyVrlWx/ROELBq860w6 y2kGmE+joGSHztUUBzFi9TQKztbKQwtxYWQXtvqjIanjb5TToqKoqjIJSdHDWZNw KAvk8b6SA3CPsMErKflxvm1/MqraD2SVEZP+8tvF7s5fXmHUJg0XFh5OFyu0CN50 V0N/IbooTVWdVI= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=YpjqxyXDyrb0cmKZ5KDxNiBfBW8=; b=rLp 2/G2eyZZIxjaUG3KIubRXrO+5GvPkc0ouNdj7BRy/HuXbkJOFsWdyTuF/NvCnCnH C6XewAnwJYIxLDnaI2deoTIdSK4W7c0DQDYSw3fQ1fHqwDBnEdlY3L7P9VMJt8Ew 9VEIsesIdOm/EgerNzzHfinauQEsEJ/00OAyWlCE= Received: (qmail 18835 invoked by alias); 9 Sep 2019 15:53:29 -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 18822 invoked by uid 89); 9 Sep 2019 15:53:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=armv7-m, armv7m X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:53:28 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpHtZ007289 for ; Mon, 9 Sep 2019 17:53:26 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=SOkjjfACemC2p0XY5xL48RW5iBDf61PzVXxG+ERhVfM=; b=H8nnBptvCTji9LG3NUH3Hbj/EVptpKUkp9rAb7OLKfRT+fT5swFPOFiQeyYcDBfYUgFO 4BK1d2v6NBRVfN+xr6atpx6ENm2KGkXW62SUW3IogscWcvhOqAXLyu71RVEZNXKvR+eu kPD8Irw0ZtQ3cL9Ykodf876Gp6Q2qV3jbvjIr9u9OLFJ9ir8pbOfy33Vhd4re9NgBDKw 6232miIpKefK4JXJ5q4mZaJ8l6knt9Gac1tHb6CBE4j1Zb+PSl9HLnV/GM9SVIq6NCcs n+10P7fzSV6FJt4sBXKEi3PuqSUaFXD2OEZ4Lx3BTJ84IgAOtP3AuKenp62BZb7Haqk3 1g== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa71hk-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:53:26 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 5BE5A23 for ; Mon, 9 Sep 2019 15:53:23 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id B7F592B2E79 for ; Mon, 9 Sep 2019 17:53:17 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:53:17 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 23/24] [ARM] FDPIC: Implement libitm support. Date: Mon, 9 Sep 2019 17:45:05 +0200 Message-ID: <20190909154526.11630-24-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon The ldaddr macro in sjlj.S needs to be updated to support the FDPIC model. 2019-XX-XX Christophe Lyon libitm/ * config/arm/sjlj.S (ldaddr): Add FDPIC support. Change-Id: Ieb2c6613363341d109c3500af0575b133b17407d -- 2.6.3 diff --git a/libitm/config/arm/sjlj.S b/libitm/config/arm/sjlj.S index a9abf16..5d44964 100644 --- a/libitm/config/arm/sjlj.S +++ b/libitm/config/arm/sjlj.S @@ -49,7 +49,16 @@ .arch armv7-m #endif -#if defined(HAVE_MOVT) && defined(PIC) +#if defined(__FDPIC__) +.macro ldaddr reg, addr + ldr \reg, 99f + add \reg, \reg, r9 +.subsection 1 + .align 2 +99: .word \addr(GOTOFF) +.subsection 0 +.endm +#elif defined(HAVE_MOVT) && defined(PIC) .macro ldaddr reg, addr movw \reg, #:lower16:(\addr - (98f + PC_OFS)) movt \reg, #:upper16:(\addr - (98f + PC_OFS)) From patchwork Mon Sep 9 15:45:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173413 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4542623ilq; Mon, 9 Sep 2019 08:53:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbXGLopXH9eAKzOnuJafVRD1fDPzjsXVyn5OFfkwdYigU2TQg4V3pc/9Lf5S+X81Ke/2eE X-Received: by 2002:a50:b1ab:: with SMTP id m40mr24934776edd.5.1568044439266; Mon, 09 Sep 2019 08:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044439; cv=none; d=google.com; s=arc-20160816; b=miI6J/efvrtS+CuV6duApOQDlZnGXR5YHLXr76aVqTSWU++LG5Gaq0jVY0D3S0TbXJ Hmk7AE6XipVljKYb9ky92yGE/IdbbXNin1h96TIxMIfwBAXBMq37lDgtCFkC9SNS9sXk Me966XGPojiSPqZa6APU8qmFMoJAXVmgTNppxXda/YWHcZW5814nz2SXnB80wPWJVUsw 9IHU/3xuPEZRH8fMV4NI4mRQtpepN7ZP8D7RLUUdLgrHiqesmUYIbOrnX1mI5//snhVm o1jYuTIrTRWe2WLo2FTvo70ebE6yfEVC4HoLElY9FGWoS6xmLYbKKK+HfHrpmWuVbSiz IEEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=gRqDxlHZfUv1t/d3krrIPmxBTHPFbFa3KQs8wrKgneA=; b=AQlUw/mDEQuYd2JS4KF04yvsn4TBhMAW9GiqZl95ryZ5bWJLgHLRkqbrG/4RA2I3mb iv2xzALMRaOJQTML4XA1tuFKUNdfQOYEjg77sNAe/5gtuEF2VKQihwWzXeb5pjOotKHe gCNnICPynRv2ZfS0CbRO7C9zLZ8gIkA4oTwnkRczwDI74DvMjf7LAg0HEUWQ+PfG2Ksh v8ISOYbJxgPt+fpwkyW3GuZAFfJjrBHYWwvGLqa0IMjhDhGqC0KF73AGIlKuPqv8JW2x 9xkbutg4kWgFiTvfMk7hDHHR5tYAZiYadS8pwfHR+mZueggmDrWRwxMf6+3FfDDstxPA Q5eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=t+YUVReV; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=zwpWl9u4; spf=pass (google.com: domain of gcc-patches-return-508667-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508667-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id e50si9145745edb.177.2019.09.09.08.53.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:53:59 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508667-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=t+YUVReV; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=zwpWl9u4; spf=pass (google.com: domain of gcc-patches-return-508667-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508667-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=vzotqqhFfS7DxAwuRYtReK5fjDfXq Wm81+kKv8opJpx6GdIt62WwUsUBlLEzsscP33nN2bCIqA7tPi9Ru4hDxr1ppnVpb 74WHToFgh5n+OrjR3aDZPdv91dYz6/okEnBltXOeZKiWCnprtDfKju1Un46eXaNr gPHd6I8RWE1pBE= 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 :to:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=zM0ArLZxAk1N/hMAPaHEBSjgEHI=; b=t+Y UVReV7bPQ2C7ryMepPg5kpjm8NJ0h/laH+IpBpORBlB0lJ/JguOcJgLIYft8+WJh nMVobp2I2l7yRMDVB8xZvf1yvp4CLp0o4gpw03xqGH8qsHXpcRro76NaEJnQ23eQ XiISKAuR9Q7l7E4MTm0JJfFFeSohPGCIY8dXeDAg= Received: (qmail 20394 invoked by alias); 9 Sep 2019 15:53:46 -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 20386 invoked by uid 89); 9 Sep 2019 15:53:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 15:53:44 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpHtf007289 for ; Mon, 9 Sep 2019 17:53:42 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=gRqDxlHZfUv1t/d3krrIPmxBTHPFbFa3KQs8wrKgneA=; b=zwpWl9u4JGutOmp3IZUuXarq78xELk3SWUP8MqDAVi98qcI379d+w2p5g3MZYXYUXZ49 V4QUhQJ9kldW/ughBV9isRCkcb5unAn4wdJ0qANO3aREf1qZmuGFGcX1eUwKEDVE7YAl h2olOV2gOkDQ/ui/L0G9dXTvEQgYYA+qga6Wbq6ygHW2HJpzw3fbfZYCvyYUiFGvOgUT YL36jvbxJLbjremFy1XLdPpnvc8xaXTtID3nAUnYM43kgW9aSDqqzbo++PBa6KXYUN0t /9G7j4JgjcXIC5S2vhdZszWyefp+XaFAz9ZeUT/IlmtCzSw2MIWsmQf6cbwRyeGVpiJl Jg== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa71jw-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:53:41 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id AB2D324 for ; Mon, 9 Sep 2019 15:53:38 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id EADF22BDA70 for ; Mon, 9 Sep 2019 17:53:37 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:53:37 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 24/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in libstdc++ configure scripts Date: Mon, 9 Sep 2019 17:45:06 +0200 Message-ID: <20190909154526.11630-25-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon 2019-XX-XX Christophe Lyon libstdc++-v3/ * acinclude.m4: Handle uclinux*. * configure: Regenerate. * configure.host: Handle uclinux* Change-Id: Ia1b53693625e4153a090fcfc925a4d605bc98e59 -- 2.6.3 diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index bc9095f..ad2cb01 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1441,6 +1441,9 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [ ac_has_nanosleep=yes ac_has_sched_yield=yes ;; + uclinux*) + ac_has_nanosleep=yes + ac_has_sched_yield=yes esac elif test x"$enable_libstdcxx_time" != x"no"; then @@ -1526,7 +1529,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [ if test x"$ac_has_clock_monotonic" != x"yes"; then case ${target_os} in - linux*) + linux* | uclinux*) AC_MSG_CHECKING([for clock_gettime syscall]) AC_TRY_COMPILE( [#include @@ -4424,7 +4427,7 @@ AC_DEFUN([GLIBCXX_ENABLE_FILESYSTEM_TS], [ freebsd*|netbsd*|openbsd*|dragonfly*|darwin*) enable_libstdcxx_filesystem_ts=yes ;; - gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*) enable_libstdcxx_filesystem_ts=yes ;; rtems*) @@ -4606,7 +4609,7 @@ dnl AC_MSG_CHECKING([for sendfile that can copy files]) AC_CACHE_VAL(glibcxx_cv_sendfile, [dnl case "${target_os}" in - gnu* | linux* | solaris*) + gnu* | linux* | solaris* | uclinux*) GCC_TRY_COMPILE_OR_LINK( [#include ], [sendfile(1, 2, (off_t*)0, sizeof 1);], diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 4e714e5..c63789c 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -6652,7 +6652,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -9598,7 +9598,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -11138,7 +11138,12 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) + +# uclinux* changes (here and below) have been submitted to the libtool +# project, but have not yet been accepted: they are GCC-local changes +# for the time being. (See +# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -14822,7 +14827,12 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) + +# uclinux* changes (here and below) have been submitted to the libtool +# project, but have not yet been accepted: they are GCC-local changes +# for the time being. (See +# https://lists.gnu.org/archive/html/libtool-patches/2018-05/msg00000.html) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -20899,6 +20909,9 @@ $as_echo "$glibcxx_glibc217" >&6; } ac_has_nanosleep=yes ac_has_sched_yield=yes ;; + uclinux*) + ac_has_nanosleep=yes + ac_has_sched_yield=yes esac elif test x"$enable_libstdcxx_time" != x"no"; then @@ -21347,7 +21360,7 @@ $as_echo "$ac_has_nanosleep" >&6; } if test x"$ac_has_clock_monotonic" != x"yes"; then case ${target_os} in - linux*) + linux* | uclinux*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime syscall" >&5 $as_echo_n "checking for clock_gettime syscall... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28316,7 +28329,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinuxfdpic*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac @@ -47824,7 +47837,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinuxfdpic*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac @@ -54011,7 +54024,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinuxfdpic*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac @@ -72654,7 +72667,7 @@ fi case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then @@ -74326,7 +74339,7 @@ $as_echo_n "checking whether to build Filesystem TS support... " >&6; } freebsd*|netbsd*|openbsd*|dragonfly*|darwin*) enable_libstdcxx_filesystem_ts=yes ;; - gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*) enable_libstdcxx_filesystem_ts=yes ;; rtems*) @@ -74878,7 +74891,7 @@ $as_echo_n "checking for sendfile that can copy files... " >&6; } $as_echo_n "(cached) " >&6 else case "${target_os}" in - gnu* | linux* | solaris*) + gnu* | linux* | solaris* | uclinux*) if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host index 57e1c50..898db37 100644 --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -264,7 +264,7 @@ case "${host_os}" in linux-musl*) os_include_dir="os/generic" ;; - gnu* | linux* | kfreebsd*-gnu) + gnu* | linux* | kfreebsd*-gnu | uclinux*) if [ "$uclibc" = "yes" ]; then os_include_dir="os/uclibc" elif [ "$bionic" = "yes" ]; then @@ -321,7 +321,7 @@ esac # Set any OS-dependent and CPU-dependent bits. # THIS TABLE IS SORTED. KEEP IT THAT WAY. case "${host}" in - *-*-linux*) + *-*-linux* | *-*-uclinux*) case "${host_cpu}" in i[567]86) abi_baseline_pair=i486-linux-gnu @@ -355,7 +355,7 @@ case "${host}" in fi esac case "${host}" in - arm*-*-linux-*) + arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver" ;; esac