What is needed to support uclinux shared libraries on MMU-lessARM?

John Lee chunqiang77@163.com
Mon Jun 14 02:27:00 GMT 2004


Bernardo Innocenti wrote:
>> I have subscribed to the uClinux-dev mailing list, but
>> nobody concerns it.
>
>I don't quite understand.  Did you mean that nobody
>cares about adding shared library support for MMU-less
>ARMs?  I've seen this question asked several times on
>the uClinux mailing-list.
>
>If you meant that nobody knows about it, well all the
>people who made the current ARM and m68k toolchains
>for uClinux are active posters in uclinux-dev and
>they helped me a lot with my m68k work.

I am sorry for my poor English. I mean that nobody
reply to my question in uClinux-dev mail list.

>> 1. In function main() of the application, what is the 
>> first value of a5?  Who load the initialization of a5?
>
>Look for get_pic_a5() in linux-2.4.x/arch/m68knommu/platform/5307/signal.c.
>For 2.6, I dunno where they've hidden it ;-)

According to the source code in linux-2.4.x/arch/m68knommu/platform/5307/signal.c
and in linux-2.4.x/arch/m68knommu/platform/5307/entry.S, Before the program return
from system call, get_pic_a5() will be called to get the value of a5. Is it right?

>For libraries, there's also an additional trick in the
>startup code:
>
>/* We've got to provide an entry point that doesn't stuff around with a5 like
> * C routines tend to do.  We must also setup a5 from d5 which won't point to
> * this libraries data segment but from which it can be obtained.
> */
>asm(    ".globl lib_main\n\t"
>        ".type lib_main,@function\n"
>        "lib_main:\n\t"
>        "move.l d5, a5\n\t"
>        "bra.w main\n"
>        ".L__end_lib_main__:\n\t"
>        ".size lib_main,.L__end_lib_main__-libmain"
>);
>
>This is in uclinux/lib/libc/main.c, but uClibc also links
>this file when it's built as a shared library (see uClibc's
>top-level Makefile).

Who calls function lib_main()? If nobody calls it, these code
will not work in any case.

Thanks and Regards
John Lee






More information about the Gcc mailing list