This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: Problems about generating dynamic library using mipsisa32-elftarget toolchain


Jie Zhang <zhangjie@magima.com.cn> writes:
> I have problems about generating dynamic library using mipsisa32-elf
> target toolchain,

Why are you using mipsisa32-elf?  It's not really designed to handle
dynamic libraries.  You're much better off with a toolchain for your
target OS (*-linux-gnu, or whatever).

> For the following simple code:
>
>    /* t.c */
>    extern void bar ()
>
>    void foo ()
>    {
>      bar ();
>    }
>
>  > mipsisa32-elf-gcc -fpic -c t.c

Yeah, mipsisa32-elf defaults to the EABI, which has no support for PIC.
If you want SVR4 PIC, you should instead use:

    mipsisa32-elf-gcc -mabi=32 -mabicalls -c t.c

Richard


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