From a4768ccd28e54efa495e0e11da1a3e9feef2abfc Mon Sep 17 00:00:00 2001 From: Eddie Antonio Santos Date: Wed, 30 Dec 2015 15:05:57 -0700 Subject: [PATCH] ar: add examples and clean-up --- pages/common/ar.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pages/common/ar.md b/pages/common/ar.md index d52f32256..2e46b2d51 100644 --- a/pages/common/ar.md +++ b/pages/common/ar.md @@ -2,10 +2,22 @@ > Create, modify, and extract from archives (.a .so .o) -- Extract members of the archive +- Extract all members from an archive -`ar -x libfoo.a` +`ar -x {{libfoo.a}}` -- List the content (files) of libfoo.a +- List the members of an archive -`ar -t libfoo.a` +`ar -t {{libfoo.a}}` + +- Replace or add files to an archive + +`ar -r {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}` + +- Insert an object file index (equivalent to using `ranlib`) + +`ar -s {{libfoo.a}}` + +- Create an archive with files and an accompanying object file index + +`ar -rs {{libfoo.a}} {{foo.o}} {{bar.o}} {{baz.o}}`