From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6293 invoked by alias); 3 Feb 2014 13:57:22 -0000 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 Received: (qmail 6281 invoked by uid 89); 3 Feb 2014 13:57:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.skoda.cz Received: from smtp.skoda.cz (HELO smtp.skoda.cz) (62.84.154.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Feb 2014 13:57:20 +0000 Received: from srv-exch-cas2.skoda.cz (srv-exch-cas2.skoda.cz [10.42.12.22]) (using TLS with cipher AES128-SHA (128/128 bits)) (Client did not present a certificate) by smtp.skoda.cz (Mail Gateway) with SMTP id C7.4A.00440.D30AFE25; Mon, 3 Feb 2014 14:57:17 +0100 (CET) Received: from SRV-EXCH-MBX1.skoda.cz ([fe80::2825:2145:d8fd:7223]) by srv-exch-cas2.skoda.cz ([fe80::b889:84f:3b8e:4530%14]) with mapi id 14.03.0158.001; Mon, 3 Feb 2014 14:57:17 +0100 From: =?iso-8859-2?B?SmFu4ehlayBKafjt?= To: "gcc-help@gcc.gnu.org" Subject: RE: Library functions running in RAM Date: Mon, 03 Feb 2014 13:57:00 -0000 Message-ID: <65513286F68AA34992CFC96B7C77DF3982E382DC@SRV-EXCH-MBX1.skoda.cz> Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg00016.txt.bz2 -----Original Message----- From: Jan=E1=E8ek Ji=F8=ED=20 Sent: Monday, February 03, 2014 1:06 PM To: 'gcc-help@gcc.gnu.org' Subject: Library functions running in RAM Dear all, I am trying to produce the linker description file to allow the execution o= f some functions from RAM of Cortex-R4. These functions are compiled in a l= ibrary.lib. How should the linker description look to simply attach just needed functio= ns from given library into the RAM section? I have tried to apply a dirty way by enumerating the needed objects. By using ar.exe I got a list of objects within included within the library.= I need just a few functions contained in some of objects. Nevertheless I received an error message that the regions FLASH0 and RAM_CO= DE overflowed by some Bytes (even KB) although there is enough space define= d for these regions. SECTIONS { .text : { KEEP(*(.intvecs)) *(.text*) *(EXCLUDE_FILE(a.obj b.obj))=20=20=20=20=20=20=20=20=20=20=20=20=20=20 *(.rodata*) } > FLASH0 .ram_funcs : { ram_funcs_start =3D .; a.obj (*(.text*)) b.obj (*(.text*)) } > RAM_CODE AT > FLASH0 ram_funcs_size =3D SIZEOF(.ram_funcs); ram_funcs_load_start =3D LOADADDR(.ram_funcs); etc. Of course, the program will perform copying the RAM functions from ROM duri= ng start-up. Environment: ARM Cortex-R4 GCC 4.8 2013q4 Kind regards JiriJ -------------------------------------- Dear all, I have applied a few changes and re-ordered the sections: SECTIONS { .ram_funcs : { ram_funcs_start =3D .; *a.obj (.text*) *b.obj (.text*) } > RAM_CODE AT > FLASH0 ram_funcs_size =3D SIZEOF(.ram_funcs); ram_funcs_load_start =3D LOADADDR(.ram_funcs); .text : { KEEP(*(.intvecs)) *(EXCLUDE_FILE(a.obj b.obj), .text)=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 *(.text*) *(.rodata*) } > FLASH0 etc. But the linker complains there are undefined references to the functions ju= st defined in the objects a.obj and b.obj.. These object files are located in the known/defined path - the same one whe= re other object files produced by the compiler are located. Thanks for your hints in advance, JiriJ