Jivin vivek tyagi lays it down ...
> Hi
> 
> I am working on Shared flat file support for uClinux (No MMU ARM ).The
> gcc version
> I am using is 2.95 and 3.4.0.Theory of operation is similar to that
> implemented for m68k.I have implemented -mshared-library-id flag ,and
> store/ restore sl (GOT register in
> 
> arm)
> I am not using the  _current_shared_library_a5_offset_ .The library id
> calculation(i.e id=arm_library_id * -4 -4) is done in the compiler
> itself.The defsym argument to

I am not sure how you can change this to be compile time since it is
determined at load time IIRC.

This has to do with XIP and shared libraries across multiple
applications.

Now I haven't looked at this in a long long time,  so I may be wrong,
just thought I'd check that you have worked it through :-)

Cheers,
Davidm

> 
> linker(ld.real) in ld(script) is commented out.
> 
> so the gcc -mshared-library-id=1
> 
> generates following function prologue and epilogue(for gcc 2.95)      
>       mov     ip ,sp
>       stmdb   sp!,{sl,fp,ip,lr,pc}    /*store sl on stack*/
>       sub     sl,sl,#8                /*bad hack to update sl*/
>       ldr     sl,[sl]         /*bad hack continues.. ideally this should 
>       be one
> instruction i.e ldr  sl,[sl,# - 8] ...its in my TODO  list*/
>       ....................
>       ...................
>       ...................
>       ldmdb   fp,{sl,fp,sp,pc}        /*restore sl */
> 
> 
> But to implement "-R" option it is s important that the function calls
> should be via GOT i.e
> ******c-code**************
> foo()
> {}
> main()
> {
> foo();
> }
> 
> ******************************
> 
> is to be called as
> 
> ****compiler output***********
> 
>       ldr     r3, .L4
>       mov   lr,pc
>       ldr    pc[sl,r3]
> 
> .L4:
>       .word   foo(GOT)        
> 
> ******************************
> 
> as opposed to
>       bl foo(PLT)
> 
> 
> where sl holds the address of GOT.(binfmt_flat loader ensures that
> before the program start)
> 
> in gcc 3.4.0 this is some how achieved if the function attribute
> __attribute__((weak)) is specified.But no idea for 2.95
> 
> Kindly bail me out on this one.(I have posted a similar request on GCC
> mailing list)
> 
> Sincere Thanks in advance.
> 
> Vivek Tyagi
> _______________________________________________
> uClinux-dev mailing list
> [email protected]
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by [email protected]
> To unsubscribe see:
> http://mailman.uclinux.org/mailman/options/uclinux-dev

-- 
David McCullough,  [EMAIL PROTECTED],   Ph:+61 734352815
Secure Computing - SnapGear  http://www.uCdot.org http://www.cyberguard.com
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to