From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10869 invoked by alias); 28 Apr 2005 15:10:22 -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 10178 invoked from network); 28 Apr 2005 15:09:38 -0000 Received: from unknown (HELO mail2-new.vianetworks.nl) (212.61.9.29) by sourceware.org with SMTP; 28 Apr 2005 15:09:38 -0000 Received: from [192.168.2.194] (kw71029.iae.nl [212.61.71.29]) by mail2-new.vianetworks.nl (Postfix) with ESMTP id D303F546E01; Thu, 28 Apr 2005 17:09:37 +0200 (CEST) Message-ID: <4270FCB0.50705@bonfrer.com> Date: Thu, 28 Apr 2005 15:39:00 -0000 From: David Bonfrer User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: Nick Garnett , ecos-discuss@sources.redhat.com References: <200504270959.j3R9xYcY010497@router.bonfrer.thuis> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [ECOS] RE: eCos Loader X-SW-Source: 2005-04/txt/msg00296.txt.bz2 Where did it go wrong in your dynamic loader? I now have the relocation types R_386_GLOB_DAT and R_386_JMP_SLOT implemented. I only used pointers, mallocs and file I/O(read and lseek) so it should be usable on all platforms. Nick Garnett wrote: >"David Bonfrer" writes: > > > >>The GOT and PLT are no problem, I already have those working, >> >> > >I don't know which architecture you are working on, but I suspect you >have been lucky. > > > >>I loaded the >>following module: >> >>----- Begin >> >>#include >>int a = 1; >>int b = 2; >>int c = 3; >> >>void optel() { >> a += 1; >> b += a; >> c += b; >>} >> >>void print() { >> diag_printf("Testfile: TEST_OK\n"); >>} >> >>----- End >> >> >> > >Yep, that's about as far as I got before realizing that there were >many more hurdles to overcome, particularly the toolchain issues I >mentioned before. > > > > >>Both optel and print are working. >>But diag_printf is hardcoded in my code. >>If you put "foo("Testfile: TEST_OK\n");" It does exactly the same now. >> >>I was wondering, I do use location = *diag_printf in my code, that uses the >>symbol table of the main ecos lib. I thought maybe there is a way to access >>it, and get the right pointer locations from there. >> >> > >I'm not really sure what you mean here. You should be resolving any >symbols in the loaded library against the symbol table in the >main executable. However, for this to happpen, the main executable >must have been linked against the load library to build its symbol >table. > > > > > > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss