This is the mail archive of the
mailing list for the GCC project.
Re: What is needed to support uclinux shared libraries on MMU-lessARM?
- From: "John Lee" <chunqiang77 at 163 dot com>
- To: gcc at gcc dot gnu dot org <gcc at gcc dot gnu dot org>
- Cc: bernie at develer dot com <bernie at develer dot com>
- Date: Fri, 11 Jun 2004 15:2:1 +0800
- Subject: Re: What is needed to support uclinux shared libraries on MMU-lessARM?
Bernardo Innocenti, thanks again!
>I don't know for sure since I've not used the ARM much
>and never with uClinux. I think it's better if you
>subscribe to the uClinux mailing list (which I've now
>added in Cc).
I have subscribed to the uClinux-dev mailing list, but
nobody concerns it.
>> How does "move (a5 - id*4),a5" work? In other words, What is the
>> initialization of a5? How the initialization of a5 to be loaded?
>It's an array containing pointers to arrays of pointers to functions
>and other symbols. Tricky :-)
>Each library/program has its own array of symbols. The master array
>indexes libraries by their IDs.
>> 2. The function epilogue code is not changed to restore the
>> GOT pointer accordingly,why?
>I think it's because all objets must be compiled with the
>-mid-shared-library compiler flag so A5 will always contain
>the same value everywhere.
>Each function reloads it "just in case", perhaps because
>it could have been called by another context which doesn't
>preserve A5. (thread entry points, signal handlers, callbacks,
>It would be more efficient to load A5 once in main() and
>leave it there, but then you'd need to explicitly tell
>the compiler to reload A5 in a few special functions,
>defating the intent of this technique (i.e.: making the
>library thing as transparent as possible for maximum
I don't understand it yet.
The main() function of an application(id = 0) would call function
TestA() in libA(a shared library, id = 2), function TestA() would
call function TestB() in libB(another shared library, id = 3), and
function function TestB() would call a function in other shared
library, then after compiled:
In function main(), there are instructions as below:
move (a5 - 0*4),a5
in function TestA() in libA, there are instructions as below:
move (a5 - 2*4),a5
and in function TestB() in libB, there are instructions as below:
move (a5 - 3*4),a5
As you see, the value of a5 is changed ceaselessly.
So I have the following questions:
1. In function main() of the application, what is the
first value of a5? Who load the initialization of a5?
2. When the application running in TestB(), the value of a5
will equal to ((a5 - 0*4) - 2*4) - 3*4.
I think it must be wrong somewhere in my comprehension.
But where is wrong?
3. After the application returning from TestA() to the function
main(),the value of a5 in function main(() will be changed to
(a5 - 0*4) - 2*4. Is it right?
Thanks and Regards