This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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,
>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?

Thanks and Regards
John Lee





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]