The archiver and library maintainer artc is a tool to build library files and it offers the possibility to replace, extract and remove modules from an existing library.
The invocation syntax is:
artc key_option [sub_option...] library [object_file]
This section describes all options for the archiver. Some suboptions can only be used in combination with certain key options. They are described together. Suboptions that can always be used are described separately.
The archiver is a command line tool so there are no equivalent options in EDE.
Description | Option | Suboption | ||||||||||||
Display an overview of all options | -? | |||||||||||||
Display version information | -V | |||||||||||||
Print object module to standard output | -p | |||||||||||||
Main functions | ||||||||||||||
Delete object module from library | -d |
-v
Move object module to another position |
-m |
-a -b -
v |
Replace or add an object module |
-r |
-a -b -
c -u -v |
Print a table of contents of the library |
-t |
-s0 -s1 |
Extract an object module from the library |
-x |
-v | |
Table 4-1: Overview of archiver options and suboptions
Displays an overview of all command line options.
The following invocations display a list of the available command line options:
artc -? artc
-
Delete the specified object modules from a library. With the suboption -v the archiver shows which files are removed.
-v Verbose: the archiver shows which files are removed.
artc -d lib.a obj1.o obj2.o
The archiver deletes obj1.o and obj2.o from the library lib.a.
artc -d -v lib.a obj1.o obj2.o
The archiver deletes obj1.o and obj2.o from the library lib.a and displays which files are removed.
-
Move the specified object modules to another position in the library.
The ordering of members in a library can make a difference in how programs are linked if a symbol is defined in more than one member.
Default, the specified members are moved to the end of the archive. Use the suboptions -a or -b to move them to a specified place instead.
-a posname Move the specified object module(s) after the existing module posname.
-b posname Move the specified object module(s) before the existing module posname.
Suppose the library lib.a contains the following objects (see option - t):
obj1.o obj2.o obj3.o
To move obj1.o to the end of lib.a:
artc -m lib.a obj1.o
To move obj3.o just before obj2.o:
artc -m -b obj3.o lib.a obj2.o
The library lib.a after these two invocations now looks like:
obj3.o obj2.o obj1.o
Archiver option -t (Print library contents)
Print the specified object module(s) in the library to standard output.
This option is only useful when you redirect or pipe the output to other files or tools that serve your own purposes. Normally you do not need this option.
artc -p lib.a obj1.o > file.o
The archiver prints the file obj1.o to standard output where it is redirected to the file file.o. The effect of this example is very similar to extracting a file from the library but in this case the 'extracted' file gets another nam.
-
You can use the option -r for several purposes:
The option -r normally adds a new module to the library. However, if the library already contains a module with the specified name, the existing module is replaced. If you specify a library that does not exist, the archiver creates a new library with the specified name.
If you add a module to the library without specifying the suboption -a or -b, the specified module is added at the end of the archive. Use the suboptions -a or -b to insert them to a specified place instead.
-a posname Add the specified object module(s) after the existing module posname.
-b posname Add the specified object module(s) before the existing module posname.
-c Create a new library without checking whether it already exists. If the library already exists, it is overwritten.
-u Insert the specified object module only if it is newer than the module in the library.
-v Verbose: the archiver shows which files are removed.
The suboptions -a or -b have no effect when an object is added to the library.
Suppose the library lib.a contains the following objects (see option -t):
obj1.o
To add obj2.o to the end of lib.a:
artc -r lib.a obj2.o
To insert obj3.o just before obj2.o:
artc -r -b obj2.o lib.a obj3.o
The library lib.a after these two invocations now looks like:
obj1.o obj3.o obj2.o
To create a new library file, add an object file and specify a library that does not yet exist:
artc -r obj1.o newlib.a
The archiver creates the library newlib.a and adds the object obj1.o to it.
To create a new library file and overwrite an existing library, add an object file and specify an existing library with the supoption - c:
artc -r -c obj1.o lib.a
The archiver overwrites the library lib.a and adds the object obj1.o to it. The new library lib.a only contains obj1.o.
Archiver option -t (Print library contents)
Print a table of contents of the library to standard out. With the suboption -s you the archiver displays all symbols per object file.
-s0 Displays per object the library in which it resides, the name of the object itself and all symbols in the object.
-s1 Displays only the symbols of all object files in the library.
artc -t lib.a
The archiver prints a list of all object modules in the library lib.a.
artc -t -s0 lib.a
The archiver prints per object all symbols in the library. This looks like:
prolog.o symbols: lib.a:prolog.o:___Qabi_callee_save lib.a:prolog.o:___Qabi_callee_restore div16.o symbols: lib.a:div16.o:___udiv16 lib.a:div16.o:___div16 lib.a:div16.o:___urem16 lib.a:div16.o:___rem16
-
Display version information. The archiver ignores all other options or input files.
artc -V
The archiver does not perform any tasks but displays the following version information:
TASKING TriCore VX-toolset ELF archiver vxx.yrz Build nnn Copyright year Altium BV Serial# 00000000
-
Extract an existing module from the library.
-o Give the extracted object module the same date as the last-modified date that was recorded in the library.
Without this suboption it receives the last-modified date of the moment it is extracted.
-v Verbose: the archiver shows which files are extracted.
To extract the file obj.o from the library lib.a:
artc -x lib.a obj1.o
If you do not specify an object module, all object modules are extracted:
artc -x lib.a
-
With this suboption you tell the archiver to suppress all warnings above the specified level. The level is a number between 0 - 9.
The level of a message is printed between parentheses after the warning number. If you do not use the -w option, the default warning level is 8.
To suppresses warnings above level 5:
artc -x -w5 lib.a obj1.o
-