RE: modifying libgcc.a

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>Ok, I guess I have some updates on the problem below:
>When I do "gcc test.program.c -lgcc", it works. Does that mean linker does
>not link the output of gcc with libgcc? Should I seek for the problem in
>gcc or in my linker? (perior to changing libgcc, I never needed to use
>libgcc).

>Thank you
>David

Everything is ok. The linker automatically adds the lib suffix. So when you
execute -lgcc it means either -llibgcc.a or -llibgcc.so. This depends on
what link option you choose (-static, -shared).

Regards,
Blazej



----- Original Message ----
From: Navid Toosizadeh <navid_toosizadeh@xxxxxxxxx>
To: gcc-help@xxxxxxxxxxx
Sent: Thursday, January 22, 2009 1:08:06 PM
Subject: modifying libgcc.a

Greetings,

For some reason, I like to modify libgcc.a after GCC is built. I intend to
add new definitions for macros such as mulsi3 existing in libgcc.a. Here's
what I did:

I compiled the new definition of mulsi3, made the object and then converted
it to libgcc.a using "ar".

Now, to test this, I wrote a small program that multiplies two numbers. When
I do "gcc test_program.c libgcc.a" it compiles and the output is correct.

But when I do : "gcc test_program.c", it throws an error complaining about
undefined reference to __mulsi3, although I did put the libgcc.a in the path
(and the linker doesn't complain there's no libgcc when I tried -lgcc).

Could you help e understand why the definition of __mulsi3 is not used from
libgcc.a when I test "gcc test_program.c"?

Best regards
Navid


      





----------------------------------------------------------------------
Sprawdz, co wyswietlaja kina w Twoim miescie!
http://link.interia.pl/f2028


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux