Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Ar (Unix)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====System V (or GNU) variant==== System V ar uses a '/' character (0x2F) to mark the end of the filename; this allows for the use of spaces without the use of an extended filename. Then it stores multiple extended filenames in the data section of a file with the name "//", this record is referred to by future headers. A header references an extended filename by storing a "/" followed by a decimal offset to the start of the filename in the extended filename data section. The format of this "//" file itself is simply a list of the long filenames, each separated by one or more LF characters. Note that the decimal offsets are number of characters, not line or string number within the "//" file. This is usually the second entry of the file, after the symbol table which always is the first. System V ar uses the special filename "/" to denote that the following data entry contains a symbol lookup table, which is used in ar libraries to speed up access. This symbol table is built in three parts which are recorded together as contiguous data. # A 32-bit big endian integer, giving the number of entries in the table. # A set of 32-bit big endian integers. One for each symbol, recording the position within the archive of the header for the file containing this symbol. # A set of Zero-terminated strings. Each is a symbol name, and occurs in the same order as the list of positions in part 2. Some System V systems do not use the format described above for the symbol lookup table. For operating systems such as [[HP-UX]] 11.0, this information is stored in a data structure based on the [[System Object Model (file format)|SOM]] file format. The special file "/" is not terminated with a specific sequence; the end is assumed once the last symbol name has been read. To overcome the 4 GiB file size limit some operating system like [[Solaris (operating system)|Solaris]] 11.2 and GNU use a variant lookup table. Instead of 32-bit integers, 64-bit integers are used in the symbol lookup tables. The string "/SYM64/" instead "/" is used as identifier for this table<ref name="ar64bit">{{cite web|title=ar.h(3HEAD)|url=https://docs.oracle.com/cd/E36784_01/html/E36873/ar.h-3head.html|work=docs.oracle.com|publisher=Oracle Corporation|date=11 November 2014|access-date=14 November 2018}}</ref> ===== Windows variant ===== The Windows (PE/COFF) variant is based on the SysV/GNU variant. The first entry "/" has the same layout as the SysV/GNU symbol table. The second entry is another "/", a Microsoft extension that stores an extended symbol cross-reference table. This one is sorted and uses little-endian integers.<ref name="Levine99"/><ref>{{Citation |url=http://www.microsoft.com/msj/0498/hood0498.aspx |first=Matt |last=Pietrek |author-link=Matt Pietrek |title=Under The Hood |work=Microsoft Systems Journal |date=April 1998 |access-date=2014-08-23 |archive-url=https://web.archive.org/web/20070624034732/https://www.microsoft.com/msj/0498/hood0498.aspx |archive-date=2007-06-24 }}</ref> The third entry is the optional "//" long name data as in SysV/GNU.<ref>{{cite web |title=llvm-mirror/llvm: archive.cpp (format detection) |url=https://github.com/llvm-mirror/llvm/blob/ad1310e/lib/Object/Archive.cpp#L593-L610 |website=GitHub |access-date=10 February 2020 |language=en}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)