public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: David Bonfrer <ecos@bonfrer.com>
To: Nick Garnett <nickg@ecoscentric.com>, ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] RE: eCos Loader
Date: Thu, 28 Apr 2005 15:39:00 -0000	[thread overview]
Message-ID: <4270FCB0.50705@bonfrer.com> (raw)
In-Reply-To: <m3ekcvrzr4.fsf@xl5.calivar.com>

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" <ecos@bonfrer.com> 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 <cyg/infra/diag.h>
>>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

  reply	other threads:[~2005-04-28 15:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200504270959.j3R9xYcY010497@router.bonfrer.thuis>
2005-04-28 10:01 ` Nick Garnett
2005-04-28 15:39   ` David Bonfrer [this message]
2005-04-28 19:06     ` Nick Garnett
     [not found] <20050426204513.30E1BE5BC7@ws7-2.us4.outblaze.com>
2005-04-27  0:21 ` David Bonfrer
2005-04-27  8:25   ` Andrew Lunn
2005-04-27 10:28   ` Nick Garnett
2005-04-27 18:06     ` Paul D. DeRocco
2005-04-28 10:06       ` Nick Garnett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4270FCB0.50705@bonfrer.com \
    --to=ecos@bonfrer.com \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=nickg@ecoscentric.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).