Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

4.1.6.4.1. nios2-elf-ar Usage Example

To archive your object files using the nios2-elf-ar command, perform the following steps:

  1. Open a Nios® II command shell.
  2. Change to the directory in which your object files are located.
  3. In the command shell, type the following command:
    nios2-elf-ar q <archive_name>.a <object files>

The example shows how to create an archive of all of the object files in your current directory. In the example, the q option directs the command to append each object file it finds to the end of the archive. After the archive file is created, it can be distributed for others to use, and included as an argument in linker commands, in place of a long object file list.

nios2-elf-ar Command Response

$ nios2-elf-ar q <archive_name>.a *.o
nios2-elf-ar: creating <archive_name>.a