From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32073 invoked by alias); 10 Mar 2010 16:39:25 -0000 Received: (qmail 31969 invoked by uid 22791); 10 Mar 2010 16:39:23 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 10 Mar 2010 16:39:17 +0000 Received: from spaceape13.eur.corp.google.com (spaceape13.eur.corp.google.com [172.28.16.147]) by smtp-out.google.com with ESMTP id o2AGdFV9026697 for ; Wed, 10 Mar 2010 08:39:15 -0800 Received: from bwz21 (bwz21.prod.google.com [10.188.26.21]) by spaceape13.eur.corp.google.com with ESMTP id o2AGdD5P020234 for ; Wed, 10 Mar 2010 08:39:14 -0800 Received: by bwz21 with SMTP id 21so3476651bwz.15 for ; Wed, 10 Mar 2010 08:39:13 -0800 (PST) Received: by 10.204.151.91 with SMTP id b27mr2027777bkw.110.1268239153523; Wed, 10 Mar 2010 08:39:13 -0800 (PST) Received: from coign.google.com (dhcp-172-22-126-240.mtv.corp.google.com [172.22.126.240]) by mx.google.com with ESMTPS id 14sm3454041bwz.10.2010.03.10.08.39.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Mar 2010 08:39:12 -0800 (PST) To: Dukextra Cc: gcc-help@gcc.gnu.org Subject: Re: "causes a section type conflict" References: <27847975.post@talk.nabble.com> From: Ian Lance Taylor Date: Wed, 10 Mar 2010 16:39:00 -0000 In-Reply-To: <27847975.post@talk.nabble.com> (Dukextra's message of "Wed\, 10 Mar 2010 02\:36\:30 -0800 \(PST\)") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true 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/msg00151.txt.bz2 Dukextra writes: > 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. Ian