This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: RE: eCos Loader
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: "David Bonfrer" <ecos at bonfrer dot com>
- Cc: "'Anthony Tonizzo'" <atonizzo at lycos dot com>,<ecos-discuss at sources dot redhat dot com>
- Date: 28 Apr 2005 10:56:15 +0100
- Subject: Re: [ECOS] RE: eCos Loader
- References: <200504270959.j3R9xYcY010497@router.bonfrer.thuis>
"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.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss