Skip to main content

IAR Embedded Workbench for RISC-V 3.40

IAR utilities

In this section:

This section describes the IAR utilities that handle the ELF and DWARF object formats.

Descriptions of utilities options

The following pages give detailed reference information about each command line option available for the different utilities.

-a

Syntax

-a

For use with

ielfdumpriscv

Description

Use this option as a shortcut for ‑‑all ‑‑no_strtab.

Caution

This option is not available in the IDE.

‑‑all

Syntax

‑‑all

For use with

ielfdumpriscv

Description

Use this option to include the contents of all ELF sections in the output, in addition to the general properties of the input file. Sections are output in index order, except that each relocation section is output immediately after the section it holds relocations for.

By default, no section contents are included in the output.

Caution

This option is not available in the IDE.

‑‑bin

Syntax
‑‑bin[=range]
Parameters

See Specifying ielftool address ranges.

For use with

ielftool

Description

Sets the format of the output file to raw binary, a binary format that includes only the raw bytes, with no address information. If no range is specified, the output file will include all the bytes from the lowest address for which there is content in the ELF file to the highest address for which there is content. If a range is specified, only bytes from that range are included. Note that in both cases, any gaps for which there is no content will be generated as zeros.

Note

If a range with no content is specified, no output file is created.

Caution

To set related options, choose:

Project>Options>Output converter

‑‑bin-multi

Syntax
‑‑bin-multi[=range[;range...]]
Parameters

See Specifying ielftool address ranges.

For use with

ielftool

Description

Use this option to produce one or more raw binary output files. If no ranges are specified, a raw binary output file is generated for each range for which there is content in the ELF file. If ranges are specified, a raw binary output file is generated for each range specified for which there is content. In each case, the name of each output file will include the start address of its range. For example, if the output file is specified as out.bin and the ranges 0x0-0x1F and 0x8000-0x8147 are output, there will be two files, named out-0x0.bin and out-0x8000.bin.

Caution

This option is not available in the IDE.

‑‑checksum

Syntax
‑‑checksum {symbol[{+|-}offset]|address}:size,
algorithm[:[1|2][a|m|z][W|L|Q][x][r][R][o][i|p]]
[,start];range[;range...]
Parameters

symbol

The name of the symbol where the checksum value should be stored. Note that it must exist in the symbol table in the input ELF file.

offset

The offset will be added (or subtracted if a negative offset (-) is specified) to the symbol. Address expressions using + and - are supported in a limited fashion. For example: (start+7)-(end-2).

address

The absolute address where the checksum value should be stored.

size

The number of bytes in the checksum—1, 2, or 4. The number cannot be larger than the size of the checksum symbol.

algorithm

The checksum algorithm used. Choose between:

sum, a byte-wise calculated arithmetic sum. The result is truncated to 8 bits.

sum8wide, a byte-wise calculated arithmetic sum. The result is truncated to the size of the symbol.

sum32, a word-wise (32 bits) calculated arithmetic sum.

crc16, CRC16 (generating polynomial 0x1021)—used by default.

crc32, CRC32 (generating polynomial 0x04C11DB7).

crc64iso, CRC64iso (generating polynomial 0x1B).

crc64ecma, CRC64ECMA (generating polynomial 0x42F0E1EBA9EA3693).

crc=n, CRC with a generating polynomial of n.

1|2

If specified, choose between:

1, specifies one’s complement.

2, specifies two’s complement.

a|m|z

Reverses the order of the bits for the checksum. Choose between:

a, reverses the input bytes (but nothing else).

m, reverses the input bytes and the final checksum.

z, reverses the final checksum (but nothing else).

Note that using a and z in combination has the same effect as m.

W|L|Q

Specifies the size of the unit for which a checksum should be calculated. Choose between:

W, calculates a checksum on 16 bits in every iteration.

L, calculates a checksum on 32 bits in every iteration.

Q, calculates a checksum on 64 bits in every iteration.

If you do not specify a unit size, 8 bits will be used by default.

The input byte sequence will processed as:

  • 8-bit checksum unit size—byte0, byte1, byte2, byte3, etc.

  • 16-bit checksum unit size—byte1, byte0, byte3, byte2, etc.

  • 32-bit checksum unit size—byte3, byte2, byte1, byte0, byte7, byte6, byte5, byte4, etc.

  • 64-bit checksum unit size—byte7, byte6, byte5, byte4, byte3, byte2, byte1, byte0, byte15, byte14, etc.

Note: The checksum unit size only affects the order in which the input byte sequence is processed. It does not affect the size of the checksum symbol, the polynomial, the initial value, the width of the processor’s address bus, etc.

Most software CRC implementations use a checksum unit size of 1 byte (8 bits). The W, L, and Q parameters are almost exclusively used when a software CRC implementation has to match the checksum computed by the hardware CRC implementation. If you are not trying to cooperate with a hardware CRC implementation, the W, L, or Q parameter will simply compute a different checksum, because it processes the input byte sequence in a different order.

x

Reverses the byte order of the checksum. This only affects the checksum value.

r

Reverses the byte order of the input data. This has no effect unless the number of bits per iteration has been set using the L or W parameters.

R

Traverses the checksum range(s) in reverse order.

If the range is, for example, 0x100–0xFFF;0x2000–0x2FFF, the checksum calculation will normally start on 0x100 and then calculate every byte up to and including 0xFFF, followed by calculating the byte on 0x2000 and continue to 0x2FFF.

Using the R parameter, the calculation instead starts on 0x2FFF and continues by calculating every byte down to 0x2000, then from 0xFFF down to and including 0x100.

o

Outputs the Rocksoft model specification for the checksum.

i|p

Use either i or p, if the start value is bigger than 0. Choose between:

i, initializes the checksum value with the start value.

p, prefixes the input data with a word of size size that contains the start value.

start

By default, the initial value of the checksum is 0. If necessary, use start to supply a different initial value. If not 0, then either i or p must be specified.

range

range is one or more memory ranges for which the checksum will be calculated.

It is typically advisable to use symbols or blocks if the memory range can change. If you use explicit addresses, for example, 0x8000-0x8347, and the code then changes, you need to update the end address to the new value. If you instead use {CODE} or a symbol located at the end of the code, you do not need to update the ‑‑checksum command.

See also Specifying ielftool address ranges.

ielftool

Description

Use this option to calculate a checksum with the specified algorithm for the specified ranges. If you have an external definition for the checksum—for example, a hardware CRC implementation—use the appropriate parameters to the ‑‑checksum option to match the external design. In this case, learn more about that design in the hardware documentation. The checksum will then replace the original value in symbol. A new absolute symbol will be generated, with the symbol name suffixed with _value containing the calculated checksum. This symbol can be used for accessing the checksum value later when needed, for example, during debugging.

If the ‑‑checksum option is used more than once on the command line, the options are evaluated from left to right. If a checksum is calculated for a symbol that is specified in a later evaluated ‑‑checksum option, an error is issued.

Example

This example shows how to use the crc16 algorithm with the start value 0 over the address range 0x8000–0x8FFF:

ielftool ‑‑checksum=_ _checksum:2,crc16;0x8000-0x8FFF sourceFile.out destinationFile.out

The input data i read from sourceFile.out, and the resulting checksum value of size 2 bytes will be stored at the symbol __checksum. The modified ELF file is saved as destinationFile.out leaving sourceFile.out untouched.

In the next example, a symbol is used for specifying the start of the range:

ielftool ‑‑checksum=___checksum:2,crc16;__checksum_begin-0x8FFF sourceFile.out destinationFile.out

If BLOCK1 occupies 0x4000-0x4337 and BLOCK2 occupies 0x8000-0x87FF, this example will compute the checksum for the bytes on 0x4000 to 0x4337 and from 0x8000 to 0x87FF:

ielftool ‑‑checksum=__checksum:2,crc16;{BLOCK1};{BLOCK2} BlxTest.out BlxTest2.out
See also

Checksum calculation for verifying image integrity

Specifying ielftool address ranges

Caution

To set related options, choose:

Project>Options>Linker>Checksum

‑‑code

Syntax

‑‑code

For use with

ielfdumpriscv

Description

Use this option to dump all sections that contain executable code—sections with the ELF section attribute SHF_EXECINSTR.

Caution

This option is not available in the IDE.

‑‑core

For use with

ielfdumpriscv

Description

By default, the ISA that the input file was linked for is deduced automatically by ielfdumpriscv. Use the option ‑‑core to specify the ISA explicitly, or to override the automatic deduction. For a syntax description, see the compiler option ‑‑core, ‑‑core.

Caution

Project>Options>General Options>Target>Device

‑‑create

Syntax

‑‑create libraryfileobjectfile1 ... objectfileN

Parameters

libraryfile

The library file that the command operates on.

objectfile1 ... objectfileN

The object file(s) to build the library from. The arguments can also be archive files, in which case each member in the archive file is processed as if specified separately.

See also Rules for specifying a filename or directory as parameters.

For use with

iarchive

Description

Use this command to build a new library from a set of object files (modules) and/or archive files. The modules are added to the library in the order that they are specified on the command line.

If no command is specified on the command line, ‑‑create is used by default.

Caution

This option is not available in the IDE.

‑‑delete, -d

Syntax
‑‑delete libraryfile objectfile1 ... objectfileN
-d libraryfile objectfile1 ... objectfileN
Parameters

libraryfile

The library file that the command operates on.

objectfile1 ... objectfileN

The object file(s) that the command operates on.

See also Rules for specifying a filename or directory as parameters.

For use with

iarchive

Description

Use this command to remove object files (modules) from an existing library. All object files that are specified on the command line will be removed from the library.

Caution

This option is not available in the IDE.

‑‑disasm_data

Syntax
‑‑disasm_data
For use with

ielfdumpriscv

Description

Use this command to instruct the dumper to dump data sections as if they were code sections.

Caution

This option is not available in the IDE.

‑‑edit

Syntax

‑‑edit steering_file

Parameters

See Rules for specifying a filename or directory as parameters.

For use with

isymexport

Description

Use this option to specify a steering file for controlling which symbols are included in the isymexport output file, and if desired, also for renaming some of the symbols.

See also

Steering files.

Caution

This option is not available in the IDE.

‑‑export_locals

Syntax

‑‑export_locals [=symbol_prefix]

Parameters

symbol_prefix

A custom prefix to the names of exported symbols that replaces the default prefix LOCAL.

For use with

isymexport

Description

Use this option to export local symbols from a ROM image file, in addition to absolute symbols. The default name of the exported symbol is LOCAL_filename_symbolname. Use the optional parameter symbol_prefix to replace LOCAL with your custom prefix.

Example

When exported from the ROM image file, the symbol symb in the source file myFile.c becomes LOCAL_myFile_c_symb.

Caution

This option is not available in the IDE.

‑‑extract, -x

Syntax
‑‑extract libraryfile [objectfile1 ... objectfileN]
-x libraryfile [objectfile1 ... objectfileN]
Parameters

libraryfile

The library file that the command operates on.

objectfile1 ... objectfileN

The object file(s) that the command operates on.

See also Rules for specifying a filename or directory as parameters.

For use with

iarchive

Description

Use this command to extract object files (modules) from an existing library. If a list of object files is specified, only these files are extracted. If a list of object files is not specified, all object files in the library are extracted.

Caution

This option is not available in the IDE.

-f

Syntax
-f filename
Parameters

See Rules for specifying a filename or directory as parameters.

For use with

iarchive, ielfdumpriscv, iobjmanip, and isymexport.

Description

Use this option to make the tool read command line options from the named file, with the default filename extension xcl.

In the command file, you format the items exactly as if they were on the command line itself, except that you may use multiple lines, because the newline character acts just as a space or tab character.

Both C and C++ style comments are allowed in the file. Double quotes behave in the same way as in the Microsoft Windows command line environment.

Caution

This option is not available in the IDE.

‑‑f

Syntax
‑‑f filename
Parameters

See Rules for specifying a filename or directory as parameters.

For use with

iarchive, ielfdumpriscv, iobjmanip, and isymexport.

Description

Use this option to make the tool read command line options from the named file, with the default filename extension xcl.

In the command file, you format the items exactly as if they were on the command line itself, except that you may use multiple lines, because the newline character acts just as a space or tab character.

Both C and C++ style comments are allowed in the file. Double quotes behave in the same way as in the Microsoft Windows command line environment.

If you also specify ‑‑dependencies on the command line for the tool, extended command line files specified using ‑‑f will generate a dependency, but those specified using -f will not generate a dependency.

See also

-f.

Caution

This option is not available in the IDE.

‑‑fake_time

Syntax
‑‑fake_time
For use with

iarchive

Description

Use this option to generate library files with identical timestamps. The value used is 0x5CF00000, which corresponds to approximately 30th May 2019 at 18:08:32 (the exact time will vary depending on the time settings). This option enables you to generate identical libraries for identical object files. Without this option, the timestamp will generate unique library files from the same input files.

Caution

This option is not available in the IDE.

‑‑fill

Syntax

‑‑fill [v;]pattern;range[;range...]

Parameters

v

Generates virtual fill for the fill command. Virtual fill is filler bytes that are included in checksumming, but that are not included in the output file. The primary use for this is certain types of hardware where bytes that are not specified by the image have a known value—typically, 0xFF or 0x0.

pattern

A hexadecimal string with the 0x prefix, for example, 0xEF, interpreted as a sequence of bytes, where each pair of digits corresponds to one byte, for example 0x123456, for the sequence of bytes 0x12, 0x34, and 0x56. This sequence is repeated over the fill area. If the length of the fill pattern is greater than 1 byte, it is repeated as if it started at address 0.

range

Specifies the address range for the fill.

See also Specifying ielftool address ranges.

For use with

ielftool

Description

Use this option to fill all gaps in one or more ranges with a pattern, which can be either an expression or a hexadecimal string. The contents will be calculated as if the fill pattern was repeatedly filled from the start address until the end address is passed, and then the real contents will overwrite that pattern.

You might want to take alignment into consideration. If you generate fill that will be accessed by half-word or word accesses, you should ensure that the addresses in the filler range are half-word or word aligned.

If the ‑‑fill option is used more than once on the command line, the fill ranges cannot overlap each other.

Caution

To set related options, choose:

Project>Options>Linker>Checksum

‑‑front_headers

Syntax
‑‑front_headers
For use with

ielftool

Description

Use this option to output ELF program and section headers in the beginning of the file, instead of at the end.

Caution

This option is not available in the IDE.

‑‑generate_vfe_header

Syntax

‑‑generate_vfe_header

For use with

isymexport

Description

Use this option to declare that the image does not contain any virtual function calls to potentially discarded functions.

When the linker performs virtual function elimination, it discards virtual functions that appear not to be needed. For the optimization to be applied correctly, there must be no virtual function calls in the image that affect the functions that are discarded.

See also

Virtual function elimination.

Caution

To set this options, use:

Project>Options>Linker>Extra Options

‑‑ihex

Syntax

‑‑ihex

For use with

ielftool

Description

Sets the format of the output file to 32-bit linear Intel Extended hex, a hexadecimal text format defined by Intel.

Note

Intel Extended cannot express addresses larger than 232-1. If your application contains such addresses, you must use another format.

Caution

To set related options, choose:

Project>Options>Linker>Output converter

‑‑ihex-len

Syntax

‑‑ihex-len=length

Parameters

length

The number of data bytes in the record.

For use with

ielftool

Description

Sets the maximum number of data bytes in an Intel Hex record. This option can only be used together with the ‑‑ihex option. By default, the number of data bytes in an Intel Hex record is 16.

Caution

This option is not available in the IDE.

‑‑json

Syntax

‑‑json

For use with

ielfdumpriscv

Description

Use this option to format the output from ielfdumpriscv in JSON format. The information is the same as without the ‑‑json option, it is merely output in a machine-readable format. However, an important difference is the behavior of ‑‑all, ‑a, and similar options. Without the ‑‑json option, the first dump is information from the ELF header, and subsequent dumps are by each section in turn. With the --json option, a single large object is produced.

The JSON format contains descriptions of all fields and is recommended if you want explanations of the output.

Note

To format the output from ielfdumpriscv in JSON format, without implicitly setting other options that make the output more machine-readable, use the option --just_json.

See also

‑‑just_json

Caution

This option is not available in the IDE.

‑‑json_schema

Syntax

‑‑json_schema

For use with

ielfdumpriscv

Description

Output from ielfdumpriscv can be generated in JSON format, by using the option ‑‑json. Use this option to generate the JSON schema. The schema contains descriptions of all fields.

See also

‑‑json

Caution

This option is not available in the IDE.

‑‑just_json

Syntax
--just_json
For use with

ielfdumpriscv

Description

Use this option to format the output from ielfdumpriscv in JSON format, without implicitly setting other options that make the output more machine-readable, like the option --json does.

See also

‑‑json

Caution

This option is not available in the IDE.

‑‑no_bom

Syntax
‑‑no_bom
For use with

iarchive, ielfdumpriscv, iobjmanip, and isymexport

Description

Use this option to omit the Byte Order Mark (BOM) when generating a UTF-8 output file.

See also

‑‑text_out and Text encodings

Caution

This option is not available in the IDE.

‑‑no_error_summary

Syntax

‑‑no_error_summary

For use with

ielfdumpriscv

Description

Use this option to suppress the summary of the number of reported ielfdumpriscv errors/warnings that is printed after all other output. Errors and warnings are emitted as normal.

Caution

This option is not available in the IDE.

‑‑no_header

Syntax

‑‑no_header

For use with

ielfdumpriscv

Description

By default, a standard list header is added before the actual file content. Use this option to suppress output of the list header.

Caution

This option is not available in the IDE.

‑‑no_rel_sections

Syntax

‑‑no_rel_sections

For use with

ielfdumpriscv

Description

By default, whenever the contents of a section of a relocatable file are generated as output, the associated section, if any, is also included in the output. Use this option to suppress output of the relocation sections.

Caution

This option is not available in the IDE.

‑‑no_strtab

Syntax

‑‑no_strtab

For use with

ielfdumpriscv

Description

Use this option to suppress dumping of string table sections (sections of type SHT_STRTAB).

Caution

This option is not available in the IDE.

‑‑no_utf8_in

Syntax
‑‑no_utf8_in
For use with

ielfdumpriscv

Description

The dumper can normally determine whether ELF files produced by IAR tools use the UTF-8 text encoding or not, and produce the correct output. For ELF files produced by non-IAR tools, the dumper will assume UTF-8 encoding unless this option is used, in which case the encoding is assumed to be according to the current system default locale.

Note

This only makes a difference if any characters beyond 7-bit ASCII are used in paths, symbols, etc.

See also

Text encodings

Caution

This option is not available in the IDE.

‑‑offset

Syntax

‑‑offset [-]offset

Parameters

offset

The offset will be added (or subtracted if - is specified) to all addresses in the generated output file.

For use with

ielftool

Description

Use this option to add or subtract an offset to the address of each output record in the generated output file. The option only works on Motorola S-records, Intel Hex, TI-Txt, and Simple-Code. The option has no effect when generating an ELF file or when binary files (‑‑bin contain no address information) are generated. No content, including the entry point, will be changed by using this option, only the addresses in the output format.

Example
‑‑offset 0x30000

This will add an offset of 0x30000 to all addresses. As a result, content that was linked at address 0x4000 will be placed at 0x34000.

Caution

This option is not available in the IDE.

‑‑output, -o

Syntax
-o {filename|directory} 
‑‑output {filename|directory} 
Parameters

See Rules for specifying a filename or directory as parameters.

For use with

iarchive and ielfdumpriscv.

Description

iarchive

By default, iarchive assumes that the first argument after the iarchive command is the name of the destination library. Use this option to explicitly specify a different filename for the library.

ielfdumpriscv

By default, output from the dumper is directed to the console. Use this option to direct the output to a file instead. The default name of the output file is the name of the input file with an added id filename extension

You can also specify the output file by specifying a file or directory following the name of the input file.

Caution

This option is not available in the IDE.

‑‑parity

Syntax
‑‑parity{symbol[+offset]|address}:size,algo:flashbase[:flags];range[;range...]
Parameters

symbol

The name of the symbol where the parity bytes should be stored. Note that it must exist in the symbol table in the input ELF file.

offset

An offset to the symbol. By default, 0.

address

The absolute address where the parity bytes should be stored.

size

The maximum number of bytes that the parity generation can use. An error will be issued if this value is exceeded. Note that the size must fit in the specified symbol in the ELF file.

algo

Choose between:

odd, uses odd parity.

even, uses even parity.

flashbase

The start address of the flash memory. Parity bits will not be generated for the addresses between flashbase and the start address of the range. If flashbase and the start address of the range coincide, parity bits will be generated for all addresses

flags

Choose between:

r, reverses the byte order within each word.

L, processes 4 bytes at a time.

W, processes 2 bytes at a time.

B, processes 1 byte at a time.

range

The address range over which the parity bytes should be generated.

See also Specifying ielftool address ranges.

For use with

ielftool

Description

Use this option to generate parity bytes over specified ranges. The range is traversed left to the right and the parity bits are generated using the odd or even algorithm. The parity bits are finally stored in the specified symbol where they can be accessed by your application.

Caution

This option is not available in the IDE.

‑‑ram_reserve_ranges

Syntax

‑‑ram_reserve_ranges[=symbol_prefix]

Parameters

symbol_prefix

The prefix of symbols created by this option.

For use with

isymexport

Description

Use this option to generate symbols for the areas in RAM that the image uses. One symbol will be generated for each such area. The name of each symbol is based on the name of the area and is prefixed by the optional parameter symbol_prefix.

Generating symbols that cover an area in this way prevents the linker from placing other content at the affected addresses. This can be useful when linking against an existing image.

If ‑‑ram_reserve_ranges is used together with ‑‑reserve_ranges, the RAM areas will get their prefix from the ‑‑ram_reserve_ranges option and the non-RAM areas will get their prefix from the ‑‑reserve_ranges option.

See also

‑‑reserve_ranges.

Caution

This option is not available in the IDE.

‑‑range

Syntax

‑‑range start-end

Parameters

start-end

Disassemble code where the start address is greater than or equal to start, and where the end address is less than end.

For use with

ielfdumpriscv

Description

Use this option to specify a range for which code from an executable will be dumped.

Caution

This option is not available in the IDE.

‑‑raw

Syntax

‑‑raw

For use with

ielfdumpriscv

Description

By default, many ELF sections will be dumped using a text format specific to a particular kind of section. Use this option to dump each selected ELF section using the generic text format.

The generic text format dumps each byte in the section in hexadecimal format, and where appropriate, as ASCII text.

Note

Raw-binary does not have any problems with 64-bit addresses.

Caution

This option is not available in the IDE.

‑‑raw_io

Syntax
--raw_io
For use with

ielfdumpriscv

Description

Use this option to make ielfdumpriscv generate maximum machine-readable output, without, for example, extra newline characters. Note that this option also sets the option ‑‑no_bom implicitly.

Caution

This option is not available in the IDE.

‑‑remove_file_path

Syntax

‑‑remove_file_path

For use with

iobjmanip

Description

Use this option to make iobjmanip remove information about the directory structure of the project source tree from the generated object file, which means that the file symbol in the ELF object file is modified.

This option must be used in combination with ‑‑remove_section ".comment".

Caution

This option is not available in the IDE.

‑‑remove_section

Syntax

‑‑remove_section {section|number}

Parameters

section

The section—or sections, if there are more than one section with the same name—to be removed.

number

The number of the section to be removed. Section numbers can be obtained from an object dump created using ielfdumpriscv.

For use with

iobjmanip

Description

Use this option to make iobjmanip omit the specified section when generating the output file.

Caution

This option is not available in the IDE.

‑‑rename_section

Syntax
‑‑rename_section {oldname|oldnumber}=newname
Parameters

oldname

The section—or sections, if there are more than one section with the same name—to be renamed.

oldnumber

The number of the section to be renamed. Section numbers can be obtained from an object dump created using ielfdumpriscv.

newname

The new name of the section.

For use with

iobjmanip

Description

Use this option to make iobjmanip rename the specified section when generating the output file.

Caution

This option is not available in the IDE.

‑‑rename_symbol

Syntax
‑‑rename_symbol oldname =newname
Parameters

oldname

The symbol to be renamed.

newname

The new name of the symbol.

For use with

iobjmanip

Description

Use this option to make iobjmanip rename the specified symbol when generating the output file.

Caution

This option is not available in the IDE.

‑‑replace, -r

Syntax
‑‑replace libraryfile objectfile1 ... objectfileN
-r libraryfile objectfile1 ... objectfileN
Parameters

libraryfile

The library file that the command operates on.

objectfile1 ... objectfileN

The object file(s) that the command operates on. The arguments can also be archive files, in which case each member in the archive file is processed as if specified separately.

See also Rules for specifying a filename or directory as parameters.

For use with

iarchive

Description

Use this command to replace or add object files (modules) and/or archive files to an existing library. The modules specified on the command line either replace existing modules in the library—if they have the same name—or are appended to the library.

Caution

This option is not available in the IDE.

‑‑reserve_ranges

Syntax

‑‑reserve_ranges[=symbol_prefix]

Parameters

symbol_prefix

The prefix of symbols created by this option.

For use with

isymexport

Description

Use this option to generate symbols for the areas in ROM and RAM that the image uses. One symbol will be generated for each such area. The name of each symbol is based on the name of the area and is prefixed by the optional parameter symbol_prefix.

Generating symbols that cover an area in this way prevents the linker from placing other content at the affected addresses. This can be useful when linking against an existing image.

If ‑‑reserve_ranges is used together with ‑‑ram_reserve_ranges, the RAM areas will get their prefix from the ‑‑ram_reserve_ranges option and the non-RAM areas will get their prefix from the ‑‑reserve_ranges option.

See also

‑‑ram_reserve_ranges.

Caution

This option is not available in the IDE.

‑‑section, -s

Syntax
‑‑section sec_number|sec_name[,...]
‑s sec_number|sec_name[,...]
Parameters

sec_number

The number of the section to be dumped.

sec_name

The name of the section to be dumped.

For use with

ielfdumpriscv

Description

Use this option to dump the contents of a section with the specified number, or any section with the specified name. If a relocation section is associated with a selected section, its contents are output as well.

If you use this option, the general properties of the input file will not be included in the output.

You can specify multiple section numbers or names by separating them with commas, or by using this option more than once. If a specified section cannot be found, its contents are excluded from the output but the contents of all other segments are included.

By default, no section contents are included in the output.

Note

This option cannot be used together with the option ‑‑segment|-g.

Example
-s 3,17                  /* Sections #3 and #17
-s .debug_frame,42       /* Any sections named .debug_frame and
                            also section #42 */ 

Caution

This option is not available in the IDE.

‑‑segment, -g

Syntax
‑‑segment seg_number[,...]
‑g seg_number[,...]

Parameters

seg_number

The number of a segment whose contents will be included in the output.

For use with

ielfdumpriscv

Description

Use this option to select specific segments—parts of an executable image indicated by program headers—for inclusion in the output. If a specified segment cannot be found, it is excluded from the output but all other segments are included.

You can specify multiple segment numbers by separating them with commas, or by using this option more than once.

Note

This option cannot be used together with the option ‑‑section|-s.

Caution

This option is not available in the IDE.

‑‑self_reloc

Syntax

‑‑self_reloc

For use with

ielftool

Description

This option is intentionally not documented because it is not intended for general use.

Caution

This option is not available in the IDE.

‑‑show_entry_as

Syntax
‑‑show_entry_as name
Parameters

name

The name to give to the program entry point in the output file.

For use with

isymexport

Description

Use this option to export the entry point of the application given as input under the name name.

Caution

This option is not available in the IDE.

‑‑silent

Syntax
‑‑silent
For use with

iarchive and ielftool

Description

Causes the tool to operate without sending any messages to the standard output stream.

By default, the tool sends various messages via the standard output stream. You can use this option to prevent this. The tool sends error and warning messages to the error output stream, so they are displayed regardless of this setting.

Caution

This option is not available in the IDE.

‑‑simple

Syntax

‑‑simple

For use with

ielftool

Description

Sets the format of the output file to Simple-code, a binary format that includes address information.

Note

Simple-code can express addresses larger than 232-1. If your application contains such addresses, a Simple-code file with a higher version number will be generated. Such files can only be read by Simple-code readers that can handle this higher version.

Caution

To set related options, choose:

Project>Options>Output converter

‑‑simple-ne

Syntax

‑‑simple-ne

For use with

ielftool

Description

Sets the format of the output file to Simple code, but no entry record is generated.

Caution

To set related options, choose:

Project>Options>Output converter

‑‑source

Syntax

‑‑source

For use with

ielfdumpriscv

Description

Use this option to make ielftool include source for each statement before the code for that statement, when dumping code from an executable file. To make this work, the executable image must be built with debug information, and the source code must still be accessible in its original location.

Caution

This option is not available in the IDE.

‑‑srec

Syntax

‑‑srec

For use with

ielftool

Description

Sets the format of the output file to Motorola S-records, a hexadecimal text format defined by Motorola. Note that you can use the ielftool options ‑‑srec-len and ‑‑srec-s3only to modify the exact format used.

Note

Motorola S-records cannot express addresses larger than 232-1. If your application contains such addresses, you must use another format.

Caution

To set related options, choose:

Project>Options>Output converter

‑‑srec-len

Syntax

‑‑srec-len=length

Parameters

length

The number of data bytes in each S-record.

For use with

ielftool

Description

Sets the maximum number of data bytes in an S-record. This option can only be used together with the ‑‑srec option. By default, the number of data bytes in an S-record is 16.

Caution

This option is not available in the IDE.

‑‑srec-s3only

Syntax

‑‑srec-s3only

For use with

ielftool

Description

Restricts the S-record output to contain only a subset of records, that is S0, S3 and S7 records. This option can be used in combination with the ‑‑srec option.

Caution

This option is not available in the IDE.

‑‑strip

Syntax

‑‑strip

For use with

iobjmanip and ielftool.

Description

Use this option to remove all sections containing debug information before the output file is written. iobjmanip will also remove the names of all module-local function, variable, and section symbols.

Note

ielftool needs an unstripped input ELF image. If you use the ‑‑strip option in the linker, remove it and use the ‑‑strip option in ielftool instead.

Caution

To set related options, choose:

Project>Options>Linker>Output>Include debug information in output

‑‑symbols

Syntax
‑‑symbols libraryfile
Parameters

libraryfile

The library file that the command operates on.

See also Rules for specifying a filename or directory as parameters.

For use with

iarchive

Description

Use this command to list all external symbols that are defined by any object file (module) in the specified library, together with the name of the object file (module) that defines it.

In silent mode (‑‑silent), this command performs symbol table-related syntax checks on the library file and displays only errors and warnings.

Caution

This option is not available in the IDE.

‑‑text_out

Syntax
‑‑text_out{utf8|utf16le|utf16be|locale}
Parameters

utf8

Uses the UTF-8 encoding

utf16le

Uses the UTF-16 little-endian encoding

utf16be

Uses the UTF-16 big-endian encoding

locale

Uses the system locale encoding

For use with

iarchive, ielfdumpriscv, iobjmanip, and isymexport

Description

Use this option to specify the encoding to be used when generating a text output file.

The default for the list files is to use the same encoding as the main source file. The default for all other text files is UTF-8 with a Byte Order Mark (BOM).

If you want text output in UTF-8 encoding without BOM, you can use the option ‑‑no_bom as well.

See also

‑‑no_bom and Text encodings

Caution

This option is not available in the IDE.

‑‑titxt

Syntax

‑‑titxt

For use with

ielftool

Description

Sets the format of the output file to Texas Instruments TI–TXT, a hexadecimal text format defined by Texas Instruments.

Note

Texas Instruments TI–TXT can express addresses larger than 232-1.

Caution

To set related options, choose:

Project>Options>Output converter

‑‑toc, -t

Syntax
‑‑toc libraryfile
-t libraryfile
Parameters

libraryfile

The library file that the command operates on.

See also Rules for specifying a filename or directory as parameters.

For use with

iarchive

Description

Use this command to list the names of all object files (modules) in a specified library.

In silent mode (‑‑silent), this command performs basic syntax checks on the library file, and displays only errors and warnings.

Caution

This option is not available in the IDE.

‑‑use_full_std_template_names

Syntax

‑‑use_full_std_template_names

For use with

ielfdumpriscv

Description

Normally, the names of some standard C++ templates are used in the output in an abbreviated form in the demangled names of symbols, for example, "std::string" instead of "std::basic_string<char, std::char_traits<char>, std_::allocator<char>>". Use this option to make ielfdumpriscv use the unabbreviated form.

Caution

This option is not available in the IDE.

‑‑utf8_text_in

Syntax
‑‑utf8_text_in
For use with

iarchive, ielfdumpriscv, iobjmanip, and isymexport

Description

Use this option to specify that the tool shall use the UTF-8 encoding when reading a text input file with no Byte Order Mark (BOM).

Note

This option does not apply to source files.

See also

Text encodings

Caution

This option is not available in the IDE.

‑‑update_symbol

Syntax
‑‑update_symbol symbol,{hexstring|(filename)}[,force]
Parameters

symbol

A symbol whose content you want to replace.

hexstring

A hexadecimal string with the 0x prefix, for example, 0xEF, interpreted as a sequence of bytes where each pair of digits corresponds to one byte. 0x123456, for example, is interpreted as the sequence of bytes 0x12, 0x34, and 0x56. The specified bytes become the new content for the symbol.

(filename)

A file containing the new content for the symbol. All bytes in the file are inserted as they are in the ELF file.

force

Forces the update if there are warnings.

For use with

ielftool

Description

This option replaces the ELF file content for the specified symbol. ielftool checks that the number of new content bytes (specified by a hexadecimal string, or read from a file) matches the current size of the symbol in the ELF file. If the sizes do not match, the operation is aborted.

Use the force parameter to make ielftool perform the operation even if the sizes do not match—some ELF symbols do not have sizes (typically assembler-generated, or generated by a toolchain that does not set symbol sizes in general). If you force the operation, you must be careful so you do not accidentally use the file you are updating as input, because that will corrupt it.

Caution

This option is not available in the IDE.

‑‑update_typeless_globals

Syntax

‑‑update_typeless_globals[=codeSectionName,dataSectionName]

Parameters

codeSectionName

The name of the code section.

dataSectionName

The name of the data section.

For use with

iobjmanip

Description

Use this option to update the type of relevant global symbols in an object file.

A global symbol that does not have an ELF type (ELF attribute STT_NOTYPE) will have its type set to Code (STT_FUNC) or Data (STT_OBJECT). When no parameters are specified, the attributes of the section that contains the symbol are used to determine if this is a Code or a Data symbol.

If the optional section names are used, then the symbols in sections that match the dataSectionName will be treated as Data. Similarly, the symbols in sections that match the codeSectionName will be treated as Code. If a section does not match either the dataSectionName or the codeSectionName, then a warning will be generated and any symbols in that section will not be updated.

Caution

This option is not available in the IDE.

‑‑verbose, -V

Syntax
‑‑verbose
-V (iarchive only)
For use with

iarchive and ielftool.

Description

Use this option to make the tool report which operations it performs, in addition to giving diagnostic messages.

Caution

This option is not available in the IDE because this setting is always enabled.

‑‑version

Syntax
‑‑version
For use with

iarchive, ielfdumpriscv, ielftool, iobjmanip, isymexport

Description

Use this option to make the tool send version information to the console and then exit.

Caution

This option is not available in the IDE.

‑‑vtoc

Syntax
‑‑vtoc libraryfile
Parameters

libraryfile

The library file that the command operates on.

See also Rules for specifying a filename or directory as parameters.

For use with

iarchive

Description

Use this command to list the names, sizes, and modification times of all object files (modules) in a specified library.

In silent mode (‑‑silent), this command performs basic syntax checks on the library file, and displays only errors and warnings.

Caution

This option is not available in the IDE.