Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do we find out which object file is pulled in by the linker?

1 view
Skip to first unread message

prix prad

unread,
Nov 20, 2009, 7:25:18 PM11/20/09
to
Hi,
Two object files foo_1.o and foo_2.o each have the same function a()
defined and they
have no other functions. foo_1.o is in a library specified prior to
the library including
foo_2.o

The linker would pull in only foo_1.o in this case. What option can I
give to
gcc / ld to verify the above statement?

Pritam

prix prad

unread,
Nov 20, 2009, 8:02:10 PM11/20/09
to

I basically looked at
http://stackoverflow.com/questions/715502/how-do-linkers-decide-what-parts-of-libraries-to-include

and

http://www.lurklurk.org/linkers/linkers.html#staticlibs

I understand the theory behind it, I am looking at how to get the
visible proof
w.r.t. what the linker is actually doing w.r.t. pulling in the object
files.

Pritam

Keith Thompson

unread,
Nov 20, 2009, 8:44:22 PM11/20/09
to

That's not a C question. You might try asking in gnu.gcc.help.

--
Keith Thompson (The_Other_Keith) ks...@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"

prix prad

unread,
Nov 20, 2009, 8:52:02 PM11/20/09
to
On Nov 20, 5:44 pm, Keith Thompson <ks...@mib.org> wrote:

Sure, will do.
Thanks,
Pritam

prix prad

unread,
Nov 20, 2009, 9:27:48 PM11/20/09
to
> Pritam- Hide quoted text -
>
> - Show quoted text -

Got the answer in the below thread.

http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/b6a55efe4a58d431/2d6c082f1e420334?lnk=raot#2d6c082f1e420334

Pritam

0 new messages