From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28108 invoked by alias); 26 Apr 2005 21:01:47 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 26826 invoked from network); 26 Apr 2005 21:01:13 -0000 Received: from unknown (HELO router.bonfrer.thuis) (82.72.197.168) by sourceware.org with SMTP; 26 Apr 2005 21:01:13 -0000 Received: from bonfie (localhost [127.0.0.1]) by router.bonfrer.thuis (8.13.1/8.13.1) with ESMTP id j3QK3dex009649; Tue, 26 Apr 2005 22:03:40 +0200 Message-Id: <200504262003.j3QK3dex009649@router.bonfrer.thuis> From: "David Bonfrer" To: "'Anthony Tonizzo'" , Date: Wed, 27 Apr 2005 00:21:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In-Reply-To: <20050426204513.30E1BE5BC7@ws7-2.us4.outblaze.com> Subject: [ECOS] RE: eCos Loader X-SW-Source: 2005-04/txt/msg00258.txt.bz2 Hi, I'm using ELF executable and shared libs. I know that *diag_printf points to the function diag_printf. The question is: How do I get this in general? I don't want to fill my own tables with: If ("printf"){location = *printf} If ("scanf") {location = *scanf} Etc. Can I get a symbol table from eCos for these functionsymbols? Thanks. P.S. Anthony, I am in a starting stage for this loader. I'm not ready to put it here because it's not finished and it's not very readable source code yet. -----Original Message----- From: Anthony Tonizzo [mailto:atonizzo@lycos.com] Sent: dinsdag 26 april 2005 22:45 To: ecos@bonfrer.com Subject: eCos Loader Hi: I am working on an ecos loader too. Following some conversations with Nick Garnett on the subject, I wanted to create an interface that was more similar to Linux insmod() that to a shared library. In this case, your module gets compiled with a simple gcc -c hello.c and then the loader must act as linker, and resolve relocation and references. I am still involved in the project, but I disagree with DeRocco: Inventing your own linker format is a bad idea. Because you now have to use special linkers to compile your module, or worse you have to write one. eCos libraries are ELF modules, and so should the libraries. As far as resolving external symbols, the only valid approach is a table of this type: struct { char* symbol_name; void (*fp)(void); } symbol; symbol symbol_table[] = { { "diag_printf", diag_printf }, ... which you can then fill up with the values of the functions you need. Since this table would be in memory all the time, you can selectively eliminate the functions you do not need via a CDL option or some other form of compile time option (for example, you only have pointers for kernel and semaphores, and nothing else). This should help in getting a handle on an otherwise huge table. In my application, I do not need to call external functions, but I definitely need relocation and symbol resolution. How far away is your code from prime time? Can I take a look at it to see if I can use it (and act as a beta tester in the process)? I am sorry if I replied to you personally, but the ecoscentric reflector does not seem to like my posting when I am behind my company's firewall. Regards Tony -- _______________________________________________ NEW! Lycos Dating Search. The only place to search multiple dating sites at once. http://datingsearch.lycos.com -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.3 - Release Date: 25-4-2005 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss