*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> ar (4)              
Title
Content
Arch
Section
 

Contents


AR(4)									 AR(4)


NAME    [Toc]    [Back]

     ar	- archive (library) file format

SYNOPSIS    [Toc]    [Back]

     #include <ar.h>

DESCRIPTION    [Toc]    [Back]

     The archive command ar combines several files into	one.  Archives are
     used mainly as libraries to be searched by	the link-editor	ld.

     A file produced by	ar has a magic string at the start, followed by	the
     constituent files,	each preceded by a file	header.	 The magic number and
     header layout as described	in the include file are:

	  #define ARMAG	 "!<arch>\n"
	  #define SARMAG 8
	  #define ARFMAG "`\n"

	  struct ar_hdr
	  {
		  char	 ar_name[16];
		  char	 ar_date[12];
		  char	 ar_uid[6];
		  char	 ar_gid[6];
		  char	 ar_mode[8];
		  char	 ar_size[10];
		  char	 ar_fmag[2];
	  };
	  typedef struct ar_hdr	ARHDR;

     The name is terminated with a "/" character by default.  Any remaining
     room in the name field is blank_filled.

     File names	can be any length: they	re not limited to 15 characters.  For
     additional	details, see the ABI book mentioned below and the ar(1)	man
     page.

     The ar_fmag field contains	ARFMAG to help verify the presence of a
     header.  The other	fields are left-adjusted, blank-padded numbers.	 They
     are decimal except	for ar_mode, which is octal.  The date is the
     modification date of the file at the time of its insertion	into the
     archive.

     Each file begins on a even	(0 mod 2) boundary.  With compiler releases
     7.0 and lower, a new-line is inserted between files if necessary.	The
     size given	reflects the actual size of the	file exclusive of padding.
     With compiler releases 7.1	and higher, in order to	guarantee that each
     ELF format	file is	16-byte	aligned	in the archive,	additional padding has
     been added	to the end of each file	to achieve that, using the character
     '\0'.  This enables the loader (ld) to have faster	access to members in
     the archive while performing static linking.  This	results	in the change
     of	size of	files permanently, normally increased by 1 to 15 bytes.	 With



									Page 1






AR(4)									 AR(4)



     non-ELF files, this padding would not occur.

     There is no provision for empty areas in an archive file.

     The encoding of the header	is portable across machines.  If an archive
     contains printable	files, the archive itself is printable.

SEE ALSO    [Toc]    [Back]

      
      
     ar(1), ld(1), nm(1),

     System V Application Binary Interface, ISBN 0-13-877598-2,	Prentice Hall
     System V ABI MIPS Processor Supplement, ISBN 0-13-880170-3, Prentice Hall


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
ranlib NetBSD a.out archive (library) table-of-contents format
pax Tru64 Archive file format
tar Tru64 Archive file format
ar HP-UX common archive file format
ldahread Tru64 read the archive header of a member of an archive file
ldahread IRIX read the archive header of a member of an archive file
tar HP-UX format of tar tape archive
cpio Tru64 Format of cpio archive
cpio HP-UX format of cpio archive
cpio IRIX format of cpio archive
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service