public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* question about some terms
@ 2009-05-12 13:32 loody
  2009-05-12 18:22 ` Cary Coutant
  0 siblings, 1 reply; 4+ messages in thread
From: loody @ 2009-05-12 13:32 UTC (permalink / raw)
  To: binutils

Dear all:
There are some terms I cannot figure them out clearly.
1. relocatable file:
    (are they *.a and *.o files)
2. executable file
    (are they *.out files)
3. shared object file
    (are they *.so files)
4. Dynamically loaded libraries
    (what is the difference between 3 and 4)
thanks for your help,
miloody

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

* Re: question about some terms
  2009-05-12 13:32 question about some terms loody
@ 2009-05-12 18:22 ` Cary Coutant
  2009-05-13  9:10   ` loody
  0 siblings, 1 reply; 4+ messages in thread
From: Cary Coutant @ 2009-05-12 18:22 UTC (permalink / raw)
  To: loody; +Cc: binutils

> There are some terms I cannot figure them out clearly.

There's a bit of fuzziness in these terms, but in general, you're pretty close.

> 1. relocatable file:
>    (are they *.a and *.o files)

More accurately, .a files are archive (or static) libraries, whose
members are relocatable objects (.o files).

> 2. executable file
>    (are they *.out files)

These are the output of a normal link (i.e., no -r option and no
-shared option). The ".out" extension is a bit ambiguous, as "a.out"
is both the traditional default output file name used by the Unix
assembler (usually a relocatable object, but traditionally the
assembler could also produce an executable file), and the default
output file name used by the linker. Normally an executable file has
been linked, has an entry point, and may or may not have dependencies
on shared objects (shared libraries).

> 3. shared object file
>    (are they *.so files)

Yes. Also called shared libraries or dynamic-link libraries (DLLs).

> 4. Dynamically loaded libraries
>    (what is the difference between 3 and 4)

In general, a dynamically-loaded library is a shared library that is
loaded during program execution via dlopen() (or equivalent), as
opposed to one that is listed as a dependency (directly or indirectly)
on the executable.

-cary

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

* Re: question about some terms
  2009-05-12 18:22 ` Cary Coutant
@ 2009-05-13  9:10   ` loody
  2009-05-13 14:29     ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: loody @ 2009-05-13  9:10 UTC (permalink / raw)
  To: Cary Coutant; +Cc: binutils

Hi:
2009/5/13 Cary Coutant <ccoutant@google.com>:
>> There are some terms I cannot figure them out clearly.
>
> There's a bit of fuzziness in these terms, but in general, you're pretty close.
>
>> 1. relocatable file:
>>    (are they *.a and *.o files)
>
> More accurately, .a files are archive (or static) libraries, whose
> members are relocatable objects (.o files).
>
>> 2. executable file
>>    (are they *.out files)
>
> These are the output of a normal link (i.e., no -r option and no
> -shared option). The ".out" extension is a bit ambiguous, as "a.out"
> is both the traditional default output file name used by the Unix
> assembler (usually a relocatable object, but traditionally the
> assembler could also produce an executable file), and the default
> output file name used by the linker. Normally an executable file has
> been linked, has an entry point, and may or may not have dependencies
> on shared objects (shared libraries).
>
>> 3. shared object file
>>    (are they *.so files)
>
> Yes. Also called shared libraries or dynamic-link libraries (DLLs).
>
>> 4. Dynamically loaded libraries
>>    (what is the difference between 3 and 4)
>
> In general, a dynamically-loaded library is a shared library that is
> loaded during program execution via dlopen() (or equivalent), as
> opposed to one that is listed as a dependency (directly or indirectly)
> on the executable.
>
> -cary
thanks for your kind help.
BTW, while reading ld and compare it with some sd scripts.
I saw some sections that I have no idea what it mean.
1. .sbss
2. .scommon
3. .sdata
4. .gptab
5. .lib8
6. .lit4
7. .reginfo
Those are not symbol that will be used under program.
it seems the default sections that will be generated by compiler.
Does there any document provide the whole list and purpose of them?
appreciate your kind help,
miloody

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

* Re: question about some terms
  2009-05-13  9:10   ` loody
@ 2009-05-13 14:29     ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2009-05-13 14:29 UTC (permalink / raw)
  To: loody; +Cc: Cary Coutant, binutils

loody <miloody@gmail.com> writes:

> BTW, while reading ld and compare it with some sd scripts.
> I saw some sections that I have no idea what it mean.
> 1. .sbss

Small local zero-initialized global or static variables.  The definition
of "small" varies by target.  On some targets, notably MIPS targets when
not generating PIC, it can be controlled by the -G option to the
compiler and linker.

> 2. .scommon

Small common variables.

> 3. .sdata

Small initialized global or static variables.

> 4. .gptab

A MIPS specific section which holds an array of entries.  Each entry has
two values: a -G argument and the size of the small data if that -G
argument is used.  The linker can use this to pick the optimal -G value
(MIPS permits a total of 65536 bytes in the small data sections).  I
don't know whether the GNU linker actually implements this optimization.

> 5. .lib8

Did you mean .lit8?  That is section used on Alpha and MIPS to hold 8
byte literals.  The address of the literal values is unimportant, and
the linker is permitted to combine identical 8 byte literals.  This is a
size and target specific implementation of the idea that ELF later
generalized into SHF_MERGE sections.  .lit8 was introduced in ECOFF.  It
is mostly used to hold floating point constants.

> 6. .lit4

Like .lit8, but for 4 byte literals.  This one is not used very much.

> 7. .reginfo

Used to describe which registers are used by functions in the file.
This is mainly for some MIPS optimization tools which were written at
SGI.  The GNU tools generate it but I don't think they use it for
anything.

> Does there any document provide the whole list and purpose of them?
> appreciate your kind help,

Try the MIPS ELF ABI.

Ian

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

end of thread, other threads:[~2009-05-13 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-12 13:32 question about some terms loody
2009-05-12 18:22 ` Cary Coutant
2009-05-13  9:10   ` loody
2009-05-13 14:29     ` 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).