From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2426 invoked by alias); 13 Sep 2008 09:49:43 -0000 Received: (qmail 2407 invoked by uid 22791); 13 Sep 2008 09:49:42 -0000 X-Spam-Check-By: sourceware.org Received: from hs-out-0708.google.com (HELO hs-out-0708.google.com) (64.233.178.246) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 13 Sep 2008 09:48:49 +0000 Received: by hs-out-0708.google.com with SMTP id n78so462334hsc.8 for ; Sat, 13 Sep 2008 02:48:46 -0700 (PDT) Received: by 10.90.86.10 with SMTP id j10mr6436426agb.22.1221299326786; Sat, 13 Sep 2008 02:48:46 -0700 (PDT) Received: from ?10.98.224.47? ( [32.159.226.157]) by mx.google.com with ESMTPS id l31sm11936374hsa.6.2008.09.13.02.48.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 13 Sep 2008 02:48:46 -0700 (PDT) Message-Id: <868ED7F6-E028-4DBB-AB96-4F6432707481@gmail.com> From: Andrew Thomas Pinski To: "gcc-bugzilla@gcc.gnu.org" Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (5F136) Mime-Version: 1.0 (iPhone Mail 5F136) Subject: Re: [Bug c/37506] New: attribute section is not working with constant strings Date: Sat, 13 Sep 2008 09:49:00 -0000 Cc: "gcc-bugs@gcc.gnu.org" X-IsSubscribed: yes Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-09/txt/msg01542.txt.bz2 Sent from my iPhone On Sep 13, 2008, at 2:04 AM, "nm127 at freemail dot hu" wrote: > With the __attribute__ __section__ it is possible to allocate > variables to > different section than the default ( > http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html ). In > case of the > following source code I would achieve to allocate both "foo bar" and > "Hello > World!" strings into the .xxx_section section: > > char x[] __attribute__ ((__section__(".xxx_section"))) = "foo bar"; > char* y __attribute__ ((__section__(".xxx_section"))) = "Hello > World!"; > > int main() { > return 0; > } > > However, with gcc version 4.3.1 (Debian 4.3.1-9) only the "foo bar" > string is > stored in .xxx_section: > > $ objdump -s a.out > > a.out: file format elf32-i386 > [...] > Contents of section .rodata: > 8048448 03000000 01000200 48656c6c 6f20576f ........Hello Wo > 8048458 726c6421 00 rld!. > [...] > Contents of section .xxx_section: > 8049568 666f6f20 62617200 50840408 foo bar.P... > > > -- > Summary: attribute section is not working with constant > strings > Product: gcc > Version: unknown > Status: UNCONFIRMED > Severity: normal > Priority: P3 > Component: c > AssignedTo: unassigned at gcc dot gnu dot org > ReportedBy: nm127 at freemail dot hu > GCC build triplet: 4.3.1 > GCC target triplet: i486-linux-gnu > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37506 >