From: peter on
Hi All
If I loaded a PIC library (.so file), It has an entry point in the
ELF header, see below:
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: Intel 80386
Version: 0x1
Entry point address:
0x320 <---------------- here
Start of program headers: 52 (bytes into file)
Start of section headers: 1792 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 5
Size of section headers: 40 (bytes)
Number of section headers: 26
Section header string table index: 23

The entry point is __do_global_dtors_aux, do I need to jump to there?

thanks
from Peter (cmk128(a)hotmail.com)
From: Nathan Baker on
"peter" <cmk128(a)gmail.com> wrote in message
news:174a20a4-cc02-4d50-96c8-39f431809bee(a)u22g2000yqf.googlegroups.com...
> Hi All
> If I loaded a PIC library (.so file), It has an entry point in the
> ELF header, see below:
> ELF Header:
> Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
> Class: ELF32
> Data: 2's complement, little endian
> Version: 1 (current)
> OS/ABI: UNIX - System V
> ABI Version: 0
> Type: DYN (Shared object file)
> Machine: Intel 80386
> Version: 0x1
> Entry point address:
> 0x320 <---------------- here
> Start of program headers: 52 (bytes into file)
> Start of section headers: 1792 (bytes into file)
> Flags: 0x0
> Size of this header: 52 (bytes)
> Size of program headers: 32 (bytes)
> Number of program headers: 5
> Size of section headers: 40 (bytes)
> Number of section headers: 26
> Section header string table index: 23
>
> The entry point is __do_global_dtors_aux, do I need to jump to there?
>

Is your application loading this ".so" directly? Or are you allowing the
OS's loader to load it for you? It makes a difference.

Please explain further what you are attempting to do...

Nathan.


From: peter on
On 4月13日, 上午4時19分, "Nathan Baker" <nathancba...(a)gmail.com> wrote:
> "peter" <cmk...(a)gmail.com> wrote in message
>
> news:174a20a4-cc02-4d50-96c8-39f431809bee(a)u22g2000yqf.googlegroups.com...
>
>
>
>
>
> > Hi All
> >   If I loaded a PIC library (.so file), It has an entry point in the
> > ELF header, see below:
> > ELF Header:
> >  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
> >  Class:                             ELF32
> >  Data:                              2's complement, little endian
> >  Version:                           1 (current)
> >  OS/ABI:                            UNIX - System V
> >  ABI Version:                       0
> >  Type:                              DYN (Shared object file)
> >  Machine:                           Intel 80386
> >  Version:                           0x1
> >  Entry point address:
> > 0x320                              <---------------- here
> >  Start of program headers:          52 (bytes into file)
> >  Start of section headers:          1792 (bytes into file)
> >  Flags:                             0x0
> >  Size of this header:               52 (bytes)
> >  Size of program headers:           32 (bytes)
> >  Number of program headers:         5
> >  Size of section headers:           40 (bytes)
> >  Number of section headers:         26
> >  Section header string table index: 23
>
> > The entry point is __do_global_dtors_aux, do I need to jump to there?
>
> Is your application loading this ".so" directly?  Or are you allowing the
> OS's loader to load it for you?  It makes a difference.
>
> Please explain further what you are attempting to do...
>
> Nathan.

Hi, I am making an ELF loader for my OS. I am trying to load a ELF
executable with one library as dependence. When I load that library,
there is an entry point in the ELF header. What is "entry point" mean
for a shared library?

thanks
from Peter (cmk128(a)hotmail.com)

http://peter-bochs.googlecode.com <---- bochs gui debugger :)
From: James Harris on
On 14 Apr, 16:50, peter <cmk...(a)gmail.com> wrote:

> Hi, I am making an ELF loader for my OS. I am trying to load a ELF
> executable with one library as dependence. When I load that library,
> there is an entry point in the ELF header. What is "entry point" mean
> for a shared library?

Someone else may know the answer but I can suggest the book Linkers
and Loaders by John Levine. It has some info on ELF shared objects and
may be able to help. John also moderates the group comp.compilers so
you could try there.

FWIW someone wrote a short ELF loader for an OS. Check out the
elf_load code at

http://codewiki.wikispaces.com/os+development

though it sounds like you may be beyond that stage.

James
From: peter on
On 4月15日, 上午6時24分, James Harris <james.harri...(a)googlemail.com> wrote:
> On 14 Apr, 16:50, peter <cmk...(a)gmail.com> wrote:
>
> > Hi, I am making an ELF loader for my OS. I am trying to load a ELF
> > executable with one library as dependence. When I load that library,
> > there is an entry point in the ELF header. What is "entry point" mean
> > for a shared library?
>
> Someone else may know the answer but I can suggest the book Linkers
> and Loaders by John Levine. It has some info on ELF shared objects and
> may be able to help. John also moderates the group comp.compilers so
> you could try there.
>
> FWIW someone wrote a short ELF loader for an OS. Check out the
> elf_load code at
>
>  http://codewiki.wikispaces.com/os+development
>
> though it sounds like you may be beyond that stage.
>
> James

Thanks James

My loader, not finish yet, start from Line 42

http://code.google.com/p/peter/source/browse/trunk/plibc/app/pshell/pshell.c