Linux Newbie help
 help / color / mirror / Atom feed
* (fwd) .so, .a and .o-files
@ 2002-08-15 15:34 Axel Siebenwirth
  2002-08-15 15:58 ` Ray Olszewski
  0 siblings, 1 reply; 21+ messages in thread
From: Axel Siebenwirth @ 2002-08-15 15:34 UTC (permalink / raw)
  To: linux-newbie

Sorry, I haven't seen my mail get to the list. So here goes it again.

----- Forwarded message from Axel Siebenwirth <axel@hh59.org> -----

Hi,

I have some stupid questions.

What makes the difference between .o and .so files? What is their use? Is it
just a naming convention?

When I want to link libraries to a program I am compiling, of what format do 
the libraries have to be?

I have found out that .a files are archives created with ar. What is that
for?

Many thanks and my best regards,
Axel Siebenwirth

----- End forwarded message -----
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: .so, .a and .o-files
@ 2002-08-15 20:31 Axel Siebenwirth
  0 siblings, 0 replies; 21+ messages in thread
From: Axel Siebenwirth @ 2002-08-15 20:31 UTC (permalink / raw)
  To: linux-newbie

Originally to: All


Hi Ray!

On Thu, 15 Aug 2002, Ray Olszewski wrote:

> Depends on how you link. Modern linking is done dynamically (only one copy 
> of the library is loaded into memory and shared by all apps that use it), 
> using .so libraries. Older linking was done statically (each app loaded its 
> own personal copy of the library into memory), using .a libraries.

Does this mean what I think? that when an executable is linked statically
all the libraries are in the executable? So none of the required libraries
are required when executing?

Is there a difference between statically linking object files to a library
and statically linking libraries to an executable?
I'm really sorry about such fundamental questions but I want to get
clarity about all that.

Thank you very much and my best regards,
Axel Siebenwirth
-

<-> Gateway Information.
This message originated from a Fidonet System (http://www.fidonet.org)
and was gated at TCOB1 (http://www.tcob1.net)
Please do not respond direct to this message but via the list


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: .so, .a and .o-files
@ 2002-08-15 20:25 Axel Siebenwirth
  0 siblings, 0 replies; 21+ messages in thread
From: Axel Siebenwirth @ 2002-08-15 20:25 UTC (permalink / raw)
  To: linux-newbie

Originally to: All


Hi Ray!

What is the difference between the linking that gcc does i.e. to link many
object files into an executable and  the linking that ld does?
Is it really that gcc is just to link object files together to an executable
and ld is there to link object files to an shared library?

Thank you,
Axel
-

<-> Gateway Information.
This message originated from a Fidonet System (http://www.fidonet.org)
and was gated at TCOB1 (http://www.tcob1.net)
Please do not respond direct to this message but via the list


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: .so, .a and .o-files
@ 2002-08-15 16:44 Axel Siebenwirth
  0 siblings, 0 replies; 21+ messages in thread
From: Axel Siebenwirth @ 2002-08-15 16:44 UTC (permalink / raw)
  To: linux-newbie

Originally to: All


Me again.

Whats the use of stripping object files of their symbols. Symbols reflect
the functions in an object file, right?

Axel
-

<-> Gateway Information.
This message originated from a Fidonet System (http://www.fidonet.org)
and was gated at TCOB1 (http://www.tcob1.net)
Please do not respond direct to this message but via the list


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 21+ messages in thread
* .so, .a and .o-files
@ 2002-08-15 16:19 Axel Siebenwirth
  0 siblings, 0 replies; 21+ messages in thread
From: Axel Siebenwirth @ 2002-08-15 16:19 UTC (permalink / raw)
  To: linux-newbie

Originally to: All


Hi,

I have some stupid questions.

What makes the difference between .o and .so files? What is their use? Is it
just a naming convention?

When I want to link libraries to a program I am compiling, of what format do 
the libraries have to be?

I have found out that .a files are archives created with ar. What is that
for?

Many thanks and my best regards,
Axel Siebenwirth
-

<-> Gateway Information.
This message originated from a Fidonet System (http://www.fidonet.org)
and was gated at TCOB1 (http://www.tcob1.net)
Please do not respond direct to this message but via the list


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 21+ messages in thread
* .so, .a and .o-files
@ 2002-08-15 13:19 Axel Siebenwirth
  2002-08-15 13:44 ` Axel Siebenwirth
  2002-08-15 13:44 ` Axel Siebenwirth
  0 siblings, 2 replies; 21+ messages in thread
From: Axel Siebenwirth @ 2002-08-15 13:19 UTC (permalink / raw)
  To: linux-newbie

Hi,

I have some stupid questions.

What makes the difference between .o and .so files? What is their use? Is it
just a naming convention?

When I want to link libraries to a program I am compiling, of what format do 
the libraries have to be?

I have found out that .a files are archives created with ar. What is that
for?

Many thanks and my best regards,
Axel Siebenwirth
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 21+ messages in thread
* .so, .a and .o-files
@ 2002-08-15 13:19 Axel Siebenwirth
  0 siblings, 0 replies; 21+ messages in thread
From: Axel Siebenwirth @ 2002-08-15 13:19 UTC (permalink / raw)
  To: linux-newbie

Hi,

I have some stupid questions.

What makes the difference between .o and .so files? What is their use? Is it
just a naming convention?

When I want to link libraries to a program I am compiling, of what format do 
the libraries have to be?

I have found out that .a files are archives created with ar. What is that
for?

Many thanks and my best regards,
Axel Siebenwirth
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: .so, .a and .o-files
@ 2002-08-15 12:31 Ray Olszewski
  0 siblings, 0 replies; 21+ messages in thread
From: Ray Olszewski @ 2002-08-15 12:31 UTC (permalink / raw)
  To: linux-newbie

Originally to: All


At 07:25 PM 8/15/02 +0200, Axel Siebenwirth wrote:
>Hi Ray!
>
>What is the difference between the linking that gcc does i.e. to link many
>object files into an executable and  the linking that ld does?
>Is it really that gcc is just to link object files together to an executable
>and ld is there to link object files to an shared library?


gcc compiles; it does not link. It calls ld to link. ld  links multiple .o 
files into an executable that includes the hooks to use the shared-library 
functions. Then at runtime, ld.so does the runtime linking to the .so files.



--
-------------------------------------------"Never tell me the odds!"--------
Ray Olszewski					-- Han Solo
Palo Alto, California, USA			  ray@comarre.com
-------------------------------------------------------------------------------

-

<-> Gateway Information.
This message originated from a Fidonet System (http://www.fidonet.org)
and was gated at TCOB1 (http://www.tcob1.net)
Please do not respond direct to this message but via the list


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: .so, .a and .o-files
@ 2002-08-15 12:28 Ray Olszewski
  0 siblings, 0 replies; 21+ messages in thread
From: Ray Olszewski @ 2002-08-15 12:28 UTC (permalink / raw)
  To: linux-newbie

Originally to: All


As I indicated in my message to Lawson, "static" is a tricky term, with an 
assortment of context-dependent meanings. It is messy enough that you 
should take what I write next with a grain of salt, since it is easy to get 
mixed up here.

Both .a and .so libraries get linked at runtime. .a linking was called 
static, but not in the sense you mean (at least as best I can recall). In 
that context, static meant that a dedicated copy of the needed library was 
loaded into memory and used just with that process. The .so approach was an 
improbvement on this runtime linking, loading just one copy of the library 
memory into memory and sharing it among all the processes that need those 
routines.

But when the linker ld is used with the --static option, an actual copy of 
any needed library function is incorporated into the executable, allowing 
it to run standalone (without access to the .so libraries).

At 07:31 PM 8/15/02 +0200, Axel Siebenwirth wrote:
>Hi Ray!
>
>On Thu, 15 Aug 2002, Ray Olszewski wrote:
>
> > Depends on how you link. Modern linking is done dynamically (only one copy
> > of the library is loaded into memory and shared by all apps that use it),
> > using .so libraries. Older linking was done statically (each app loaded 
> its
> > own personal copy of the library into memory), using .a libraries.
>
>Does this mean what I think? that when an executable is linked statically
>all the libraries are in the executable? So none of the required libraries
>are required when executing?
>
>Is there a difference between statically linking object files to a library
>and statically linking libraries to an executable?
>I'm really sorry about such fundamental questions but I want to get
>clarity about all that.


--
-------------------------------------------"Never tell me the odds!"--------
Ray Olszewski					-- Han Solo
Palo Alto, California, USA			  ray@comarre.com
-------------------------------------------------------------------------------

-

<-> Gateway Information.
This message originated from a Fidonet System (http://www.fidonet.org)
and was gated at TCOB1 (http://www.tcob1.net)
Please do not respond direct to this message but via the list


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

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

end of thread, other threads:[~2002-08-15 21:03 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-15 15:34 (fwd) .so, .a and .o-files Axel Siebenwirth
2002-08-15 15:58 ` Ray Olszewski
2002-08-15 16:17   ` lawson_whitney
2002-08-15 16:45     ` Ray Olszewski
2002-08-15 20:49       ` lawson_whitney
2002-08-15 17:19   ` Axel Siebenwirth
2002-08-15 17:25   ` Axel Siebenwirth
2002-08-15 18:31     ` Ray Olszewski
2002-08-15 17:31   ` Axel Siebenwirth
2002-08-15 18:28     ` Ray Olszewski
2002-08-15 21:03       ` lawson_whitney
  -- strict thread matches above, loose matches on Subject: below --
2002-08-15 20:31 Axel Siebenwirth
2002-08-15 20:25 Axel Siebenwirth
2002-08-15 16:44 Axel Siebenwirth
2002-08-15 16:19 Axel Siebenwirth
2002-08-15 13:19 Axel Siebenwirth
2002-08-15 13:44 ` Axel Siebenwirth
2002-08-15 13:44 ` Axel Siebenwirth
2002-08-15 13:19 Axel Siebenwirth
2002-08-15 12:31 Ray Olszewski
2002-08-15 12:28 Ray Olszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox