What is needed to support uclinux shared libraries on MMU-lessARM?
John Lee
chunqiang77@163.com
Fri Jun 11 08:53:00 GMT 2004
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,
>>etc.).
>>
>>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
>>portability).
>
>I don't understand it yet.
>For example:
>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
>call TestA()
>...
>in function TestA() in libA, there are instructions as below:
>...
>move (a5 - 2*4),a5
>call TestB()
>...
>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?
I know the answer of question 2 and 3 now because of the article in
the following link.
http://www.ucdot.org/article.pl?sid=03/10/21/2153216&mode=thread
thank pauli very much!
But I don't know the answer of question 1 yet, please help me!
Thanks and Regards
John Lee
More information about the Gcc
mailing list