From patchwork Mon Aug 22 14:45:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 110934 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 ECDAEB6F68 for ; Tue, 23 Aug 2011 00:45:52 +1000 (EST) Received: (qmail 21773 invoked by alias); 22 Aug 2011 14:45:46 -0000 Received: (qmail 21764 invoked by uid 22791); 22 Aug 2011 14:45:45 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qy0-f175.google.com (HELO mail-qy0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Aug 2011 14:45:27 +0000 Received: by qyk4 with SMTP id 4so1371147qyk.20 for ; Mon, 22 Aug 2011 07:45:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.189.149 with SMTP id de21mr1436986qcb.72.1314024325713; Mon, 22 Aug 2011 07:45:25 -0700 (PDT) Received: by 10.229.29.7 with HTTP; Mon, 22 Aug 2011 07:45:25 -0700 (PDT) In-Reply-To: References: <20110822053744.GM2687@tyan-ft48-01.lab.bos.redhat.com> Date: Mon, 22 Aug 2011 07:45:25 -0700 Message-ID: Subject: Re: PING: PATCH: PR target/46770: Use .init_array/.fini_array sections From: "H.J. Lu" To: Jakub Jelinek , Paolo Bonzini Cc: David Edelsohn , GCC Patches X-IsSubscribed: yes 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 On Mon, Aug 22, 2011 at 7:06 AM, H.J. Lu wrote: > On Sun, Aug 21, 2011 at 10:37 PM, Jakub Jelinek wrote: >> On Sun, Aug 21, 2011 at 05:09:59PM -0700, H.J. Lu wrote: >>> I didn't know .init_array section was enabled for AIX.  Does this patch >>> work for you? >> >> Some ELF targets (e.g. arm*-linux*) don't use elfos.h.  IMHO you should >> instead add >> #ifndef __ELF__ >> #error NonELF >> #endif >> to gcc_AC_INITFINI_ARRAY test.  And/or add another test to it that tests >> that you can actually use >> .section .init_array >> and it will use correct section flags for the section. >> > > I will update the test. Can I check in this patch to address AIX issue first? I will submit a patch to test ".section .init_array" later? Thanks. diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4 index 74c86db..a8ecd2d 100644 --- a/gcc/acinclude.m4 +++ b/gcc/acinclude.m4 @@ -377,6 +377,9 @@ AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array su pport, gcc_cv_initfini_array, [dnl if test "x${build}" = "x${target}" && test "x${build}" = "x${host}"; then AC_RUN_IFELSE([AC_LANG_SOURCE([ +#ifndef __ELF__ +#error Not an ELF OS +#endif #ifdef __ia64__ /* We turn on .preinit_array/.init_array/.fini_array support for ia64