[ECOS] RE: eCos Loader

Nick Garnett nickg@ecoscentric.com
Thu Apr 28 10:01:00 GMT 2005


"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



More information about the Ecos-discuss mailing list