From patchwork Fri Sep 24 00:35:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Howarth X-Patchwork-Id: 65609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 076B9B70A7 for ; Fri, 24 Sep 2010 10:35:35 +1000 (EST) Received: (qmail 6915 invoked by alias); 24 Sep 2010 00:35:33 -0000 Received: (qmail 6717 invoked by uid 22791); 24 Sep 2010 00:35:32 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from bromo.med.uc.edu (HELO bromo.med.uc.edu) (129.137.3.146) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Fri, 24 Sep 2010 00:35:28 +0000 Received: from bromo.med.uc.edu (localhost.localdomain [127.0.0.1]) by bromo.med.uc.edu (Postfix) with ESMTP id BCAFCB004B; Thu, 23 Sep 2010 20:35:25 -0400 (EDT) Received: (from howarth@localhost) by bromo.med.uc.edu (8.14.3/8.14.3/Submit) id o8O0ZPqV001037; Thu, 23 Sep 2010 20:35:25 -0400 Date: Thu, 23 Sep 2010 20:35:25 -0400 From: Jack Howarth To: dot@bromo.med.uc.edu, guenther@gmail.com, gcc-patches@gcc.gnu.org Cc: nathan@codesourcery.com, mikestump@comcast.net, richard@bromo.med.uc.edu Subject: [PATCH][Revisedx2] eliminate UNRESOLVED errors on attr-ifunc-[1, 5].c/attr-ifunc-[1, 4].C Message-ID: <20100924003525.GA1035@bromo.med.uc.edu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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 Currently on targets like darwin which lack alias support in their object file format, the ifunc test case gcc.dg/attr-ifunc-1.c erroneously reports as UNRESOLVED. This is due to the fact that assemble_alias() is called before the error can be emiited in do_assemble_alias(). Thus an inappropriate error message is given. The attached patch resolves this by checking for the ifunc attribute and emitting the correct error message in assemble_alias. Bootstrap and regression tested on x86_64-apple-darwin10. Okay for gcc trunk? Jack 2010-09-23 Jack Howarth * gcc/varasm.c (assemble_alias): Add error message for unsupported ifunc. Index: gcc/varasm.c =================================================================== --- gcc/varasm.c (revision 164573) +++ gcc/varasm.c (working copy) @@ -5535,8 +5535,12 @@ # else if (!DECL_WEAK (decl)) { - error_at (DECL_SOURCE_LOCATION (decl), - "only weak aliases are supported in this configuration"); + if (lookup_attribute ("ifunc", DECL_ATTRIBUTES (decl))) + error_at (DECL_SOURCE_LOCATION (decl), + "ifunc is not supported in this configuration"); + else + error_at (DECL_SOURCE_LOCATION (decl), + "only weak aliases are supported in this configuration"); return; } # endif