From patchwork Tue Dec 6 01:42:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 129491 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 95C641007D6 for ; Tue, 6 Dec 2011 12:43:04 +1100 (EST) Received: (qmail 31282 invoked by alias); 6 Dec 2011 01:43:01 -0000 Received: (qmail 31273 invoked by uid 22791); 6 Dec 2011 01:43:00 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-vw0-f47.google.com (HELO mail-vw0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Dec 2011 01:42:46 +0000 Received: by vbbfc21 with SMTP id fc21so4851624vbb.20 for ; Mon, 05 Dec 2011 17:42:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.26.179 with SMTP id m19mr6423090vdg.95.1323135765331; Mon, 05 Dec 2011 17:42:45 -0800 (PST) Received: by 10.220.229.66 with HTTP; Mon, 5 Dec 2011 17:42:45 -0800 (PST) Date: Mon, 5 Dec 2011 17:42:45 -0800 Message-ID: Subject: [PATCH] Fix ctrstuff.c with init_array support From: Andrew Pinski To: 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 Hi, Like the .ctors array, __do_global_dtors_aux_fini_array_entry and __frame_dummy_init_array_entry arrays need a specific alignment. This patch fixes those two arrays. This patch fixes the bootstrap on mips64-linux-gnu. Bootstrapped on mips64-linux-gnu. Bootstrapped and tested on x86-linux-gnu with no regressions. Thanks, Andrew Pinski libgcc/ChangeLog: * crtstuff.c (__do_global_dtors_aux_fini_array_entry): Align to the size of func_ptr. (__frame_dummy_init_array_entry): Likewise. Index: crtstuff.c =================================================================== --- crtstuff.c (revision 181901) +++ crtstuff.c (working copy) @@ -412,7 +412,7 @@ CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux) #elif defined (FINI_ARRAY_SECTION_ASM_OP) static func_ptr __do_global_dtors_aux_fini_array_entry[] - __attribute__ ((__used__, section(".fini_array"))) + __attribute__ ((__used__, section(".fini_array"), aligned(sizeof(func_ptr)))) = { __do_global_dtors_aux }; #else /* !FINI_SECTION_ASM_OP && !FINI_ARRAY_SECTION_ASM_OP */ static void __attribute__((used)) @@ -466,7 +466,7 @@ CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, frame_dummy) #else /* defined(INIT_SECTION_ASM_OP) */ static func_ptr __frame_dummy_init_array_entry[] - __attribute__ ((__used__, section(".init_array"))) + __attribute__ ((__used__, section(".init_array"), aligned(sizeof(func_ptr)))) = { frame_dummy }; #endif /* !defined(INIT_SECTION_ASM_OP) */ #endif /* USE_EH_FRAME_REGISTRY || JCR_SECTION_NAME || USE_TM_CLONE_REGISTRY */