Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Re: <em>I do not see much benefit of using it other than reducing file search time for each of object files.</em></p> <p>Your understanding of the benefit is not quite right. Archives reduce the workload of resolving individual <em>symbols</em>.</p> <p>If you link a program out of many individual <code>.o</code> files, the linker has to consider them all at the same time. The references can go in any direction. The very last <code>.o</code> on the command line can call a function in the very first <code>.o</code> and vice versa.</p> <p>This is not the case (by default, at least) with archives. With archives, functions in the earlier archives can only make references to symbols whose definitions appear in the later archives. (This is also related to the the traditional Unix convention why the <code>-l</code> linker options go at the end of the command line!!! Your <code>.o</code> files first, then the command line.)</p> <p>This means that once an archive appears which defines a symbol, you can be sure that the later archives do not use that symbol any more. Which means that you can remove it from your data structures. You are basically "done" linking that particular library; it has satisfied the prior references, and all that remains is to satisfy ITS unresolved references. If you order the linking process right, and the software is nicely layered, you can minimize how many symbols are outstanding at any time.</p> <p>Linux is more than 20 years old now and its build system has a long and rich history, just like the code. Archives were not used originally; I think that started in <code>2.6</code> only. Also, dependencies were once generated by a GNU awk script. People built the kernel on 25 Mhz 386 boxes with 4 megs of RAM, haha.</p> <p>Archives are used today because there was a need for them with the kernel getting larger. It's not just for the heck of it!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload