This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What is needed to support uclinux shared libraries on MMU-lessARM?
- From: Bernardo Innocenti <bernie at develer dot com>
- To: Bernardo Innocenti <bernie at develer dot com>
- Cc: John Lee <chunqiang77 at 163 dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 15 Jun 2004 14:00:07 +0200
- Subject: Re: What is needed to support uclinux shared libraries on MMU-lessARM?
- Organization: Develer S.r.l.
- References: <40CEE35D.5030102@develer.com>
Bernardo Innocenti wrote:
At first I think these source codes trick the linker to create an
entrance
for each library, but function main() in main.c is enough to do this.
so I'm lost too, I will try to get the answer in uClinux-dev maill list.
The comment says that lib_main must be used because C code
does the usual trick with A5. The kernel doesn't do anything
special for libraries: the entry point is set to the start
of the text segment. So I still wonder how lib_main gets
executed.
Perhaps the program startup code calls lib_main for each
library?
Nope. The startup code for regular programs is here:
uclinux/uClibc/libc/sysdeps/linux/m68k/crt0.S
It also expects the pointer to the data segment in
%d5 and the comment says it's passed by the kernel.
There's nothing about lib_main here, so I'm still
wondering *who* is calling it.
Please, put me in Cc when you ask on uClinux-dev,
I'm curious.
---cut---
.text
nop
nop
_start: /* put here so that references to _start work with elf-PIC */
movea.l %d5, %a5 /* uClinux passes in data segment here */
/*
* argc, argv and envp are on the stack, just call to main
*/
lea __uClibc_main-.-8, %a0 /* call uClibc main */
jsr %pc@(%a0)
---cut--
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/