From patchwork Mon Jul 8 13:29:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 257558 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 776C82C0087 for ; Mon, 8 Jul 2013 23:32:46 +1000 (EST) 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:cc:subject:date:message-id; q=dns; s=default; b=Q5tX+FyiDqHC eefTH1tAEBpoxkLfY0XfPgl9fIiLZLD2WUTDmLhpyLWcUd6ZWBtae3tsg4jwMugg 80zFCu6Sie4gFGYB7uZqk1i14ZT5wUZIeGi2MKNiSVqQDZh5ASykuZ+WfgykI2vg TqpMx7D5o1he8j8/TuKDZ3/Q+Ub748E= 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:cc:subject:date:message-id; s=default; bh=+OwcZK0Apv4OzSv3jm F9xsdp2u4=; b=phYXXp+NMvCf5QMEnuoiRXUo6X+XYmg9znD/CB3zlRRhn+Moso vP18Mig0FuS18KfaEFMkaXfaMpbpp1+N4mTk8dDi4v17GqtwC74OQIY30PY2MvXu xrTAWO/Jt6AaoNawECkd8WN0ux+wjk/A5rHKKBS6RD6wgKAzfQywzNjQM= Received: (qmail 26299 invoked by alias); 8 Jul 2013 13:32:40 -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 26289 invoked by uid 89); 8 Jul 2013 13:32:39 -0000 X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_00, RDNS_DYNAMIC, TW_CX, TW_EQ autolearn=no version=3.3.1 Received: from host-82-135-62-35.customer.m-online.net (HELO mail.embedded-brains.de) (82.135.62.35) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 08 Jul 2013 13:32:39 +0000 Received: by mail.embedded-brains.de (Postfix, from userid 65534) id 89C5F65253A; Mon, 8 Jul 2013 15:32:36 +0200 (CEST) Received: from eb0024.eb.z (eb0024.eb.z [192.168.96.64]) by mail.embedded-brains.de (Postfix) with ESMTP id C1C36652CFE; Mon, 8 Jul 2013 15:29:10 +0200 (CEST) From: Sebastian Huber To: gcc-patches@gcc.gnu.org Cc: rtems-devel@rtems.org, Sebastian Huber Subject: [PATCH] RTEMS: Use __cxa_atexit by default for RTEMS Date: Mon, 8 Jul 2013 15:29:09 +0200 Message-Id: <1373290149-14808-1-git-send-email-sebastian.huber@embedded-brains.de> The __cxa_atexit support is a reqirement for destructor registration of thread-local objects. For *-*-elf it is already enabled by default. See comment line 810 in "gcc/config.gcc". Define TARGET_LIBGCC_SDATA_SECTION on PowerPC for RTEMS to ".sdata" to place the __dso_handle. The __dso_handle is referenced by application code. In case this code uses the small data section, the __dso_handle must be there. This patch should be committed to GCC 4.8 and 4.9. Test results: http://gcc.gnu.org/ml/gcc-testresults/2013-07/msg00671.html gcc/ChangeLog 2013-07-08 Sebastian Huber * config.gcc (*-*-rtems*): Use __cxa_atexit by default. * config/rs6000/rtems.h (TARGET_LIBGCC_SDATA_SECTION): Define. --- gcc/config.gcc | 1 + gcc/config/rs6000/rtems.h | 3 +++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index a927964..1648dfe 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -734,6 +734,7 @@ case ${target} in yes) thread_file='rtems' ;; esac extra_options="${extra_options} rtems.opt" + default_use_cxa_atexit=yes use_gcc_stdint=wrap ;; *-*-uclinux*) diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h index b910b5e..fb22be1 100644 --- a/gcc/config/rs6000/rtems.h +++ b/gcc/config/rs6000/rtems.h @@ -34,6 +34,9 @@ } \ while (0) +#undef TARGET_LIBGCC_SDATA_SECTION +#define TARGET_LIBGCC_SDATA_SECTION ".sdata" + #undef CPP_OS_DEFAULT_SPEC #define CPP_OS_DEFAULT_SPEC "%(cpp_os_rtems)"