From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14561 invoked by alias); 1 Apr 2005 12:53:06 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 14400 invoked from network); 1 Apr 2005 12:53:00 -0000 Received: from unknown (HELO mail.wrs.com) (147.11.1.11) by sourceware.org with SMTP; 1 Apr 2005 12:53:00 -0000 Received: from ala-mail04.corp.ad.wrs.com (ala-mail04 [147.11.57.145]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id EAA10868; Fri, 1 Apr 2005 04:52:39 -0800 (PST) Received: from lul-mail03.corp.ad.wrs.com ([147.11.74.23]) by ala-mail04.corp.ad.wrs.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 1 Apr 2005 04:52:39 -0800 Received: from [147.11.80.21] ([147.11.80.21]) by lul-mail03.corp.ad.wrs.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 1 Apr 2005 14:52:56 +0200 Message-ID: <424D4412.4020700@windriver.com> Date: Fri, 01 Apr 2005 12:53:00 -0000 From: Vincent Rubiolo User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) MIME-Version: 1.0 To: Nick Clifton CC: Pieter Arnout , grigory.zagorodnev@intel.com, binutils@sources.redhat.com Subject: Re: HELP with linker script!!! References: <13ab0c503312082c7af572c83f523f4f@powerescape.com> <424BE5A7.5060902@redhat.com> <29c1ff0410ff9cc2b88a3ad82d1938aa@powerescape.com> <424D2F42.5070508@redhat.com> In-Reply-To: <424D2F42.5070508@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 Apr 2005 12:52:56.0244 (UTC) FILETIME=[B9B53F40:01C536B9] X-SW-Source: 2005-04/txt/msg00026.txt.bz2 Hello Nick, Thanks for this informative reply. There is something I am wondering about using the gcc attributes to put variables or functions : how to control the section flags of these new sections? I know I can use objcopy with the --set-section-flags to tweak section flags to my liking. I was wondering how gcc was settings these flags : for your '.cached_bss' section, it may have the NOBITS flag set but does gcc know that, for instance, the NOBITS flag will have to be set? As for Pieter problem, the crt0.c will surely rely on special symbols like __heap_start or __stack_start (set by the linker script) to detect and set the start of heap and stack. You are also encouraged to use the MEMORY keyword that Nick mentioned : it make things clearer. However, it may not suit you if you have sections that have dynamic addresses/sizes i.e computed from say, the previous section' size (you will then have to rely on the computation capabilities of the ld script). Regards, Vincent Nick Clifton wrote: [...] > your application then it is easy. Simply use the: > > __attribute__((section(".cached_bss"))) > > feature of GCC to annotate all of those variables which you want to be > placed into the cacheable RAM, and then make sure that your linker > script assigns the .cached_bss to the cacheable RAM memory region. Easy! > :-) > > MEMORY > { > cachableRAM : org = 0x100, len = 0x200 > uncacheRAM: org = 0x3000, len = 0x40000 > } > > SECTIONS > { > [...other sections...] > > .cached_bss : { *(.cached_bss) } > cachableRAM; > .bss : { *(.bss) } > uncacheRAM; > > [...other sections...] > } > > Cheers > Nick -- Reclaim Your Inbox! http://internal.vannes.wrsec.fr/twiki/bin/view/Utilities/MailThunderbird