From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7806 invoked by alias); 17 Jun 2003 08:22:27 -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 7488 invoked from network); 17 Jun 2003 08:22:22 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 17 Jun 2003 08:22:22 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h5H8MMH31454 for ; Tue, 17 Jun 2003 04:22:22 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h5H8MMI26358; Tue, 17 Jun 2003 04:22:22 -0400 Received: from localhost.localdomain.redhat.com (vpn50-13.rdu.redhat.com [172.16.50.13]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h5H8MB904572; Tue, 17 Jun 2003 04:22:20 -0400 To: sumesh_uk@hotmail.com Cc: binutils@sources.redhat.com Subject: Re: Linker question References: From: Nick Clifton Date: Tue, 17 Jun 2003 08:22:00 -0000 In-Reply-To: (Sumesh UdayaKumaran's message of "Fri, 13 Jun 2003 15:38:40 +0000") Message-ID: User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-06/txt/msg00593.txt.bz2 Hi Sumesh, > As part of a project Iam involved in, I need to maintain copies > of the same variable in different memory banks (kind of like > cache). I then want to based on criteria I have address the > different copies at different program points. This sounds like a very strange scheme. How do you intend to keep the variables in sync ? ie if a program changes variable A in bank1, how do make sure that the copy of variable A in bank2 also changes ? > 1. Where is the exact address being generated. For most cases the addresses are generated in the linker. Depending upon the target processor's instruction set and the form of addressing being used the addresses can also sometimes be computed in the assembler or in the loader. In your situation however, the most likely place where the addresses are computed is the function "mcore_elf_relocate_section" which is defined in bfd/elf32-mcore.c > 2. As an alternative , can I handle such a scheme through a script, in > other words can the script be used to guide such an addressing. You might be able to do something clever using linker scripts and overlays although I do not think that they are really designed to handle this kind of thing. I would suggest however that you consider very carefully if you really want multiple copies of the same variable at different addresses, since this is not something that the assembler or linker are really designed to allow. Cheers Nick