[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GSOC]Dynamic object file loading:basic working version
- Date: Fri, 10 Jul 2009 03:34:48 +0800
- From: jszhang3 at gmail.com (JiSheng Zhang)
- Subject: [GSOC]Dynamic object file loading:basic working version
Hi all,
Now basic symbol resolving and relocation works! The code is attached.
For test just make and then ./demo -l ./t.o -s get. If you should see
something like "******5******" plus various debug message.
Explanation:
t.c looks like this:
/*****************/
int ttt=5;
int get()
{
return ttt;
}
/****************/
so t.o should have at least one relocation and two symbols. readelf -S
t.o and readelf -s t.o prove this.
the dynamic linker load t.o and parsing it, then it loading all needed
sections, finally it will do symbol resolving and relocation.
For test I just point entry to the start of ".text" that is get
function, then call this function via entry, we should get the
result:5
TODO next week:
1.lookup external symbol which is exported by demo
2.support symbol resolving exported by object file which is dynamic loaded
Regards,
JiSheng
-------------- next part --------------
A non-text attachment was scrubbed...
Name: objdl.tar.gz
Type: application/x-gzip
Size: 9972 bytes
Desc: not available
Url : http://www.rtems.org/pipermail/rtems-users/attachments/20090710/71c4b08a/attachment.gz