Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > How do we find out which object file is pulled in by the linker?

Reply
Thread Tools

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

 
 
prix prad
Guest
Posts: n/a
 
      11-21-2009
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
 
Reply With Quote
 
 
 
 
prix prad
Guest
Posts: n/a
 
      11-21-2009
On Nov 20, 4:25*pm, prix prad <maal...@gmail.com> wrote:
> 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


I basically looked at
http://stackoverflow.com/questions/7...ies-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
 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      11-21-2009
prix prad <> writes:
> 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?


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

--
Keith Thompson (The_Other_Keith) kst- <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"
 
Reply With Quote
 
prix prad
Guest
Posts: n/a
 
      11-21-2009
On Nov 20, 5:44*pm, Keith Thompson <ks...@mib.org> wrote:
> prix prad <maal...@gmail.com> writes:
> > 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?

>
> 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"


Sure, will do.
Thanks,
Pritam

 
Reply With Quote
 
prix prad
Guest
Posts: n/a
 
      11-21-2009
On Nov 20, 5:52*pm, prix prad <maal...@gmail.com> wrote:
> On Nov 20, 5:44*pm, Keith Thompson <ks...@mib.org> wrote:
>
>
>
>
>
> > prix prad <maal...@gmail.com> writes:
> > > 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?

>
> > 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"

>
> Sure, will do.
> Thanks,
> Pritam- Hide quoted text -
>
> - Show quoted text -


Got the answer in the below thread.

http://groups.google.com/group/gnu.g...6c082f1e420334

Pritam

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
URGENT: window.open does not render server-side code when aspx file pulled from a resource file Bob Jones ASP .Net 13 02-21-2007 03:18 PM
Some File Types pulled from Image field corrupted when using Response.BinaryWrite() to download... Charlie@CBFC ASP .Net 1 05-13-2005 04:32 PM
Re: [OT] I pulled the trigger... Peter Jensen Computer Support 0 03-08-2005 01:54 PM
300D pre-order option pulled from CompUSA This Old Man Digital Photography 16 09-23-2003 11:02 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57