From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3221 invoked by alias); 11 Mar 2010 05:13:40 -0000 Received: (qmail 3212 invoked by uid 22791); 11 Mar 2010 05:13:38 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from kuber.nabble.com (HELO kuber.nabble.com) (216.139.236.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Mar 2010 05:13:31 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Npai9-00085f-Fo for gcc-help@gcc.gnu.org; Wed, 10 Mar 2010 21:13:29 -0800 Message-ID: <27859408.post@talk.nabble.com> Date: Thu, 11 Mar 2010 05:13:00 -0000 From: Dukextra To: gcc-help@gcc.gnu.org Subject: Re: "causes a section type conflict" In-Reply-To: <20100310165013.GS7634@axel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <27847975.post@talk.nabble.com> <20100310165013.GS7634@axel> X-IsSubscribed: yes 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: 2010-03/txt/msg00162.txt.bz2 Axel Freyn wrote: > > Hi Ian, >> > I have problem with GNU linker. >> > >> > I will show you simple example how it appears. But basically if I have >> set >> > one function to specified memory section and try to call function with >> > string parameter. then linker says "causes a section type conflict". >> > >> > >> > char FooBar(const char *) >> __attribute__((section(".defined_section"))); >> > void TestFunction(void) __attribute__((section(".defined_section"))); >> > >> > char FooBar(const char * s) >> > { >> > if(s) return 1; >> > else return 0; >> > } >> > >> > void TestFunction(void) >> > { >> > FooBar(1); // This works fine >> > FooBar("1") // This doesnt work, linker script says: " >> TestFunction >> > causes a section type conflict" >> > } >> > >> > >> > So what is that error message? Google didnt find any solve for this. >> >> I can't find that error message anywhere in the linker. >> >> What version of gcc? What version of GNU ld? What target? Please >> give us a complete standalone test case. Please show us the exact >> output of the linker. > At least on my machine, this error-message can result from the compiler, > not the linker. For the differen file text.c (from the (quite old) > discussion http://gcc.gnu.org/ml/gcc/2001-10/msg00707.html): > > static const int a __attribute__ ((__section__ (".data.init"))) = 1; > static int b __attribute__ ((__section__ (".data.init"))) = 1; > > I obtain: > > gcc -c test.c > test.c:2: error: b causes a section type conflict > > Maybe the OP also obtains the error from the compiler? However, for me > (gcc 4.3.2) his example compiles cleanly (except the missing ";") > > Axel > > Hi My GCC is 4.4.1 and target is PowerPC. ld-version is 2.19.1. Same problem causes with GCC-version 2.95.3. First of all. I am trying to put these functions to specified section in rom (.defined_section). Then in linker script I put/map these functions to ram memory like this. MEMORY { . . . defined_section: org = 0x10000, len = 0xFFFF section_in_rom: org = 0x4F0000, len = 0xFFFF } SECTION { . . . .section_in_rom : AT (0x10000) { *(.defined_section) } > section_in_rom } In program I copy these functions from rom to ram. Eveything of these works fine, but if I add for example one static variable in function or string parameter (like in example) I get these "causes section type error". -- View this message in context: http://old.nabble.com/%22causes-a-section-type-conflict%22-tp27847975p27859408.html Sent from the gcc - Help mailing list archive at Nabble.com.