From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13971 invoked by alias); 14 Aug 2008 07:16:08 -0000 Received: (qmail 13955 invoked by uid 22791); 14 Aug 2008 07:16:06 -0000 X-Spam-Check-By: sourceware.org Received: from rv-out-0708.google.com (HELO rv-out-0708.google.com) (209.85.198.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 14 Aug 2008 07:15:32 +0000 Received: by rv-out-0708.google.com with SMTP id c5so236435rvf.56 for ; Thu, 14 Aug 2008 00:15:30 -0700 (PDT) Received: by 10.114.158.1 with SMTP id g1mr840574wae.111.1218698130631; Thu, 14 Aug 2008 00:15:30 -0700 (PDT) Received: by 10.114.204.19 with HTTP; Thu, 14 Aug 2008 00:15:30 -0700 (PDT) Message-ID: Date: Thu, 14 Aug 2008 09:31:00 -0000 From: "Pan ruochen" To: gcc-help@gcc.gnu.org Subject: Can I control the output section for constant strings? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg00139.txt.bz2 Hi All For the following code: |----------------------------------------------------| | #define __init __attribute__((section(".init"))) | | int __init foo_init(void) | | { | | ... | | printf("foo_init\n"); | | ... | | } | |----------------------------------------------------| I want gcc to put the constant string "foo_init\n" into the section .init as well, instead of the section .rodata. And for other functions which are not marked as __init, the constant strings are put defaultly. Can I do this? And how? ------------- Best Regards, PRC Aug 14, 2008