Scroll to navigation

AR(1) Vývojové prostředky GNU AR(1)

JMÉNO

ar - create, modify, and extract from archives

POUŽITÍ

ar [-X32_64] [-]p[mod] [--plugin name] [--target bfdname] [--output dirname] [--record-libdeps libdeps] [--thin] [relpos] [count] archive [member...]

POPIS

GNU program ar tvoří nové archívy, mění jejich obsah a rozbaluje je na jednotlivé soubory. Archív je jeden soubor, jenž obsahuje více jiných souborů ve struktuře, která umožňuje získat jednotlivé původní soubory (těm říkáme členové archívu).

Obsah původního souboru, jeho přístupová práva, časové příznaky, vlastník a skupina je zaznamenána v archívu a může být opět nastavena při rozbalování.

GNU ar umí spravovat archívy, jejichž členové mají libovolnou délku jména; ovšem s přihlédnutím na nastavení ar ve vašem systému může být délka jmen členů omezena (kvůli přenositelnosti archívů na ostatní programové nástroje). Pokud takové omezení existuje, limit často bývá 15 znaků (typické pro a.out formáty) nebo 16 (typické pro coff formáty).

ar is considered a binary utility because archives of this sort are most often used as libraries holding commonly needed subroutines. Since libraries often will depend on other libraries, ar can also record the dependencies of a library when the --record-libdeps option is specified.

ar vytvoří rejstřík symbolů definovaných v alokační tabulce objektových modulů v archívu, pokud zadáme přepínač s. Jakmile je takový rejstřík jednou vytvořen, bude aktualizován vždy, když ar provede nějakou změnu v obsahu archívu (kromě aktualizační operace q). Rejstřík v archívu zrychlí linkování knihovny a dovolí podprogramům v knihovně, aby se navzájem volaly bez ohledu na jejich umístění v archívu.

Můžete použít nm -s nebo nm --print-armap k vypsání tohoto rejstříku. Pokud archív neobsahuje rejstřík, může být zavolána jiná forma ar, zvaná ranlib, která pouze přidá rejstřík k archívu.

GNU ar can optionally create a thin archive, which contains a symbol index and references to the original copies of the member files of the archive. This is useful for building libraries for use within a local build tree, where the relocatable objects are expected to remain available, and copying the contents of each object would only waste time and space.

An archive can either be thin or it can be normal. It cannot be both at the same time. Once an archive is created its format cannot be changed without first deleting it and then creating a new archive in its place.

Thin archives are also flattened, so that adding one thin archive to another thin archive does not nest it, as would happen with a normal archive. Instead the elements of the first archive are added individually to the second archive.

The paths to the elements of the archive are stored relative to the archive itself.

GNU ar je kompatibilní se dvěma různými přístupy. jeho aktivitu je možné ovládat pomocí voleb příkazového řádku, jako v různých variantách ar v Unixových systémech; nebo, pokud je určena jediná volba příkazového řádku -M, je možné jej ovládat skriptem předaným přes standardní vstup, stejně jako "knihovnický" program MRI.

VOLBY

GNU ar vám umožňuje zadat v prvním parametru příkazové řádky kód operace p a příznaky modifikátorů mod v libovolném pořadí.

Pokud chcete, může první parametr příkazové řádky začínat pomlčkou.

Klíčové písmeno p určuje, jaká operace se provede; může to být cokoliv z následujících možností, ale musíte uvést pouze jednu z nich:

Smaž (delete) moduly z archívu. Moduly ke smazání jsou určeny jako člen...; archív zůstane beze změny, pokud nezadáte žádné soubory.

Když zadáte modifikátor v, ar bude vypisovat moduly, které jsou smazávány.

Tato operace se používá k přemístění (move) členů archívu.

Pořadí členů v archívu může mít vliv na to, jak budou linkovány programy, jež užívají tuto knihovnu, pokud je nějaký symbol definován ve více než jednom členu.

Pokud nepoužijete žádné modifikátory s operací "m", každý člen uvedený v parametru člen bude přesunut na konec archívu; můžete uvést modifikátory a, b nebo i, abyste je přesunuli na určené místo.

Vypíše (Print) určené členy (jejich obsah - pozn. překl.) archívu na standardní výstup. Pokud užijete modifikátor v, ukáže se jméno modulu před jeho vypsáním na standardní výstup.

Pokud neuvedete žádné členy, budou vypsány všechny z archívu.

Rychlé přidání (Quick append); přidá člen... na konec archívu, bez kontroly přepisu.

Modifikátory a, b a i nemají vliv na tuto operaci; novější členové jsou vždy přidáni na konec archívu.

Modifikátor v způsobí, že ar vypisuje seznam přidávaných souborů.

Since the point of this operation is speed, implementations of ar have the option of not updating the archive's symbol table if one exists. Too many different systems however assume that symbol tables are always up-to-date, so GNU ar will rebuild the table even with a quick append.

Note - GNU ar treats the command qs as a synonym for r - replacing already existing files in the archive and appending new ones at the end.

Vloží soubory člen... do archívu (s přepsáním (replacement)). Tato operace se liší od q v tom, že každý člen archívu, jehož jméno souhlasí se jménem nově přidávaného člena, bude smazán.

Pokud jeden ze souborů vyjmenovaných v parametru člen... neexistuje, ar vypíše chybovou hlášku a nechá existující členy archívu s odpovídajícím jménem v původním stavu.

Jako výchozí jsou novější členové přidáváni na konec archívu; můžete použít jeden z modifikátorů a, b nebo i jako žádost o uložení na jiné místo, určené relativně vzhledem k nějakému existujícímu členu archívu.

Modifikátor v u této operace způsobí, že pro každý přidaný soubor bude na výstup vypsána jedna řádka s jedním z písmen a nebo r, jež informují, zda byl soubor přidán (appended) (žádný starý člen nebyl vymazán) nebo přepsán (replaced).

Add an index to the archive, or update it if it already exists. Note this command is an exception to the rule that there can only be one command letter, as it is possible to use it as either a command or a modifier. In either case it does the same thing.
Display a table listing the contents of archive, or those of the files listed in member... that are present in the archive. Normally only the member name is shown, but if the modifier O is specified, then the corresponding offset of the member is also displayed. Finally, in order to see the modes (permissions), timestamp, owner, group, and size the v modifier should be included.

Pokud není uveden žádný člen, budou vypsány všechny soubory archívu.

Pokud je v archívu (řekněme b.a) více souborů stejného jména (řekněme fie), ar t b.a fie vypíše pouze první výskyt; chcete-li vidět všechny, musíte požádat o celkový výpis---v našem případě ar t b.a.

Rozbaluje (extract) členy (vyjmenované v parametru member) z archívu. U této operace můžete užít modifikátor v, aby ar vypisoval jména vybalovaných souborů.

Pokud neuvedete žádné členy, budou rozbaleny všechny, které archív obsahuje.

Files cannot be extracted from a thin archive, and there are restrictions on extracting from archives created with P: The paths must not be absolute, may not contain "..", and any subdirectories in the paths must exist. If it is desired to avoid these restrictions then used the --output option to specify an output directory.

Plno modifikátorů (mod) může okamžitě následovat klíčové písmeno p, aby upřesnily chování operace:

Přidej nový soubor za (after) existujícího člena archívu. Pokud použijete modifikátor a, musí být uvedeno jméno existujícího člena jako parametr relpos, před určením archívu.
Přidej nový soubor před (before) existujícího člena archívu. Pokud použijete modifikátor b, musí být uvedeno jméno existujícího člena jako parametr relpos, před určením archívu. (stejné jako i).
Vytvoř (Create) archív. Určený archív je vytvořen vždy, když neexistuje a vy ho chcete měnit. Ale budete varováni, pokud pomocí tohoto modifikátoru neupozorníte, že očekáváte jeho vytvoření.
Operate in deterministic mode. When adding files and the archive index use zero for UIDs, GIDs, timestamps, and use consistent file modes for all files. When this option is used, if ar is used with identical options and identical input files, multiple runs will create identical output files regardless of the input files' owners, groups, file modes, or modification times.

If binutils was configured with --enable-deterministic-archives, then this mode is on by default. It can be disabled with the U modifier, below.

Zkrácení jmen archívu. GNU ar normálně přijímá jména libovolné délky. Tak mohou vzniknout archívy, jež nejsou v některých systémech přenositelné na původní ar. Pokud je tohle váš případ, můžete použít modifikátor f, aby jména souborů byla při ukládání do archívu patřičně zkrácena.
Přidej nový soubor před existujícího člena archívu. Pokud použijete modifikátor i, musí být uvedeno jméno existujícího člena jako parametr relpos, před určením archívu. (stejné jako b).
Specify dependencies of this library. The dependencies must immediately follow this option character, must use the same syntax as the linker command line, and must be specified within a single argument. I.e., if multiple items are needed, they must be quoted to form a single command line argument. For example L "-L/usr/local/lib -lmydep1 -lmydep2"
Používá parametr počet. Používá se v případě vícenásobných stejnojmenných položek v archívu. Rozbalí nebo smaže počet instancí daného jména ze souboru.
Zachovej původní (original) datum členů při rozbalování. Pokud tento modifikátor neužijete, rozbalené soubory dostanou časové razítko odpovídající času rozbalení.
Display member offsets inside the archive. Use together with the t option.
Use the full path name when matching or storing names in the archive. Archives created with full path names are not POSIX compliant, and thus may not work with tools other than up to date GNU tools. Modifying such archives with GNU ar without using P will remove the full path names unless the archive is a thin archive. Note that P may be useful when adding files to a thin archive since r without P ignores the path when choosing which element to replace. Thus

 ar rcST archive.a subdir/file1 subdir/file2 file1
    

will result in the first "subdir/file1" being replaced with "file1" from the current directory. Adding P will prevent this replacement.

Vytvoř rejstřík archívu nebo aktualizuj existující rejstřík, i když nebyly provedeny žádné změny archívu. Tento modifikátor můžete použít s libovolnou operací, nebo samostatně (jako klíčové písmeno operace - pozn. překl.). Spuštění ar s na archív má stejný účinek, jako použití ranlib.
Nevytvářej tabulku symbolů archívu. To může urychlit tvorbu rozsáhlé knihovny, pokud probíhá v několika krocích. Výsledný archív není možné použít s linkerem. Aby bylo možno vytvořit tabulku symbolů, je nutné při posledním spuštění ar vypustit modifikátor S nebo na archiv spustit ranlib.
Deprecated alias for --thin. T is not recommended because in many ar implementations T has a different meaning, as specified by X/Open System Interface.
Normálně vloží ar r... do archívu všechny vyjmenované soubory. Chcete-li vložit pouze ty, které jsou novější než existující členové stejného jména, použijte tento modifikátor. Modifikátor u je povolen pouze při operaci r (replace). Konkrétně, kombinace qu není povolená, protože kontrola časových razítek by zatratila výhodu rychlosti operace q.
Do not operate in deterministic mode. This is the inverse of the D modifier, above: added files and the archive index will get their actual UID, GID, timestamp, and file mode values.

This is the default unless binutils was configured with --enable-deterministic-archives.

Tento modifikátor vyvolá informativnější (verbose) verzi operace. Mnoho operací zobrazuje dodatečné informace, jako třeba jména zpracovávaných souborů, pokud přidáte modifikátor v.
Tento modifikátor ukáže číslo verze programu ar.

The ar program also supports some command-line options which are neither modifiers nor actions, but which do change its behaviour in specific ways:

Displays the list of command-line options supported by ar and then exits.
Displays the version information of ar and then exits.
Pro zachování kompatibility s AIX ignoruje ar počáteční volbu -X32_64. Chování dané touto volbou je pro GNU ar výchozí. ar nepodporuje žádné další -X volby; zejména nepodporuje -X32, která je výchozí pro ar v AIX.
The optional command-line switch --plugin name causes ar to load the plugin called name which adds support for more file formats, including object files with link-time optimization information.

This option is only available if the toolchain has been built with plugin support enabled.

If --plugin is not provided, but plugin support has been enabled then ar iterates over the files in ${libdir}/bfd-plugins in alphabetic order and the first plugin that claims the object in question is used.

Please note that this plugin search directory is not the one used by ld's -plugin option. In order to make ar use the linker plugin it must be copied into the ${libdir}/bfd-plugins directory. For GCC based compilations the linker plugin is called liblto_plugin.so.0.0.0. For Clang based compilations it is called LLVMgold.so. The GCC plugin is always backwards compatible with earlier versions, so it is sufficient to just copy the newest one.

The optional command-line switch --target bfdname specifies that the archive members are in an object code format different from your system's default format. See
The --output option can be used to specify a path to a directory into which archive members should be extracted. If this option is not specified then the current directory will be used.

Note - although the presence of this option does imply a x extraction operation that option must still be included on the command line.

The --record-libdeps option is identical to the l modifier, just handled in long form.
Make the specified archive a thin archive. If it already exists and is a regular archive, the existing members must be present in the same directory as archive.
@soubor
Čte volby příkazové řádky ze souboru. Načtené volby jsou vloženy na místo původní volby @soubor. Pokud soubor neexistuje nebo nelze číst, bude volba brána doslovně a nebude odstraněna.

Volby v souboru jsou odděleny bílými znaky. Bílý znak může být obsažen ve volbě, pokud je volba ohraničena jednoduchými nebo dvojitými uvozovkami. Je možné použít jakýkoliv znak (včetně zpětného lomítka), když před něj napíšeme zpětné lomítko. Soubor může obsahovat další volby @soubor; každá taková volba bude zpracována rekurzivně.

DALŠÍ INFORMACE

nm(1), ranlib(1) a položky v Info pro binutils.

COPYRIGHT

Copyright (c) 1991-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

PŘEKLAD

Překlad této příručky do španělštiny vytvořili Jirka Santolik <jiri.santolik@st.ms.mff.cuni.cz>

Tento překlad je bezplatná dokumentace; Přečtěte si GNU General Public License Version 3 nebo novější ohledně podmínek autorských práv. Neexistuje ŽÁDNÁ ODPOVĚDNOST.

Pokud narazíte na nějaké chyby v překladu této příručky, pošlete e-mail na adresu translation-team-cs@lists.sourceforge.net.

25. listopadu 2023 binutils-2.41