This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: arm-elf-gcc shared flat support
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: vivek tyagi <vivek dot list at gmail dot com>
- Cc: gcc at gnu dot org, gcc at gcc dot gnu dot org, gcc-help at gcc dot gnu dot org
- Date: Fri, 30 Mar 2007 13:42:39 +0100
- Subject: Re: arm-elf-gcc shared flat support
- References: <be163d940703300527q53011ae5kdd751e7e3e4cf4e8@mail.gmail.com>
On Fri, 2007-03-30 at 17:57 +0530, vivek tyagi wrote:
> Hi ,
>
This is the wrong list for these sorts of questions, you should really
be asking on gcc-help.
> 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.One of the major requirement is to call functions
> via GOT.
> so a code
>
> ******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 achived if the function attribute
> __attribute__((weak)) is specified.But no idea for 2.95
>
That weak calls have this property is really due to a bug in the
compiler (some day I might even fix it :-). You can probably make
things work the way you want with more recent compilers if you use
-mlong-calls, but it's not really designed for this purpose, so some
local definitions may be short-circuited.
Is there some reason why linker-generated PLT sequences aren't a
reasonable solution?
R.