public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* EXTERN command
@ 2011-02-26 10:44 ali hagigat
  2011-02-26 11:05 ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: ali hagigat @ 2011-02-26 10:44 UTC (permalink / raw)
  To: binutils

"Force symbol to be entered in the output file as an undefined symbol.
Doing this
may, for example, trigger linking of additional modules from standard
libraries."
What does it mean by "additional modules"? Are they some files?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: EXTERN command
  2011-02-26 10:44 EXTERN command ali hagigat
@ 2011-02-26 11:05 ` Alan Modra
  2011-02-28  7:46   ` ali hagigat
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2011-02-26 11:05 UTC (permalink / raw)
  To: ali hagigat; +Cc: binutils

On Sat, Feb 26, 2011 at 02:14:46PM +0330, ali hagigat wrote:
> What does it mean by "additional modules"? Are they some files?

Yes.  Object files in an archive (.a file).

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: EXTERN command
  2011-02-26 11:05 ` Alan Modra
@ 2011-02-28  7:46   ` ali hagigat
  2011-02-28 21:12     ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: ali hagigat @ 2011-02-28  7:46 UTC (permalink / raw)
  To: binutils; +Cc: Ian Lance Taylor, amodra

When i write:
gcc -lc ....
I expect libc.a is linked with my program. Does GNU ld selects some
object files from libc.a and link them with my program? or the whole
archive will be linked?


On Sat, Feb 26, 2011 at 2:35 PM, Alan Modra <amodra@gmail.com> wrote:
> On Sat, Feb 26, 2011 at 02:14:46PM +0330, ali hagigat wrote:
>> What does it mean by "additional modules"? Are they some files?
>
> Yes.  Object files in an archive (.a file).
>
> --
> Alan Modra
> Australia Development Lab, IBM
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: EXTERN command
  2011-02-28  7:46   ` ali hagigat
@ 2011-02-28 21:12     ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2011-02-28 21:12 UTC (permalink / raw)
  To: ali hagigat; +Cc: binutils, amodra

ali hagigat <hagigatali@gmail.com> writes:

> When i write:
> gcc -lc ....
> I expect libc.a is linked with my program. Does GNU ld selects some
> object files from libc.a and link them with my program? or the whole
> archive will be linked?

Try it and see what happens.

Note that -lc can link against libc.so as well as libc.a.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-28 21:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-26 10:44 EXTERN command ali hagigat
2011-02-26 11:05 ` Alan Modra
2011-02-28  7:46   ` ali hagigat
2011-02-28 21:12     ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).