10.4.4. Diagnostic Options

The options listed in the subsections below control how the linker generates diagnostic messages. On the tiarmclang command-line they should be passed to the linker using the -Wl or -Xlinker option as described in Passing Options to the Linker.

10.4.4.1. Option Summary

--diag_error

Categorizes the diagnostic identified by num as an error. See Control Linker Diagnostics.

--diag_remark

Categorizes the diagnostic identified by num as a remark. See Control Linker Diagnostics.

--diag_suppress

Suppresses the diagnostic identified by num. See Control Linker Diagnostics.

--diag_warning

Categorizes the diagnostic identified by num as a warning. See Control Linker Diagnostics.

--display_error_number

Displays a diagnostic’s identifiers along with its text. See Control Linker Diagnostics.

--emit_references:file[=\ *file*]

Emits a file containing section information. The information includes section size, symbols defined, and references to symbols. See Control Linker Diagnostics.

--emit_warnings_as_errors (-pdew)

Treats warnings as errors. See Control Linker Diagnostics.

--issue_remarks

Issues remarks (non-serious warnings). See Control Linker Diagnostics.

--no_demangle

Disables demangling of symbol names in diagnostics. See Disable Name Demangling (--no_demangle).

--no_warnings

Suppresses warning diagnostics (errors are still issued). See Control Linker Diagnostics.

--set_error_limit

Sets the error limit to num. The linker abandons linking after this number of errors. (The default is 100.) See Control Linker Diagnostics.

--verbose_diagnostics

Provides verbose diagnostics that display the original source with line-wrap. See Control Linker Diagnostics.

--warn_sections (-w)

Displays a message when an undefined output section is created. See Display a Message When an Undefined Output Section Is Created (--warn_sections).

10.4.4.2. Control Linker Diagnostics

The linker honors certain C/C++ compiler options to control linker-generated diagnostics. The diagnostic options must be specified without passing them directly to the linker with -Wl or -Xlinker.

--diag_error=num

Categorize the diagnostic identified by num as an error. To find the numeric identifier of a diagnostic message, use the --display_error_number option first in a separate link. Then use --diag_error=num to recategorize the diagnostic as an error. You can only alter the severity of discretionary diagnostics.

--diag_remark=num

Categorize the diagnostic identified by num as a remark. To find the numeric identifier of a diagnostic message, use the --display_error_number option first in a separate link. Then use --diag_remark=num to recategorize the diagnostic as a remark. You can only alter the severity of discretionary diagnostics.

--diag_suppress=num

Suppress the diagnostic identified by num. To find the numeric identifier of a diagnostic message, use the --display_error_number option first in a separate link. Then use --diag_suppress=num to suppress the diagnostic. You can only suppress discretionary diagnostics.

--diag_warning=num

Categorize the diagnostic identified by num as a warning. To find the numeric identifier of a diagnostic message, use the --display_error_number option first in a separate link. Then use --diag_warning=num to recategorize the diagnostic as a warning. You can only alter the severity of discretionary diagnostics.

--display_error_number

Display a diagnostic message’s numeric identifier along with its text. Use this option in determining which arguments you need to supply to the diagnostic suppression options (--diag_suppress, --diag_error, --diag_remark, and --diag_warning). This option also indicates whether a diagnostic is discretionary. A discretionary diagnostic is one whose severity can be overridden. A discretionary diagnostic includes the suffix “-D”; otherwise, no suffix is present. See Diagnostic Options for more information on controlling diagnostic messages.

--emit_references:file[=filename]

Emits a file containing section information. The information includes section size, symbols defined, and references to symbols. This information allows you to determine why each section is included in the linked application. The output file is a simple ASCII text file. The filename is used as the base name of a file created. For example, --emit_references:file=myfile generates a file named myfile.txt in the current directory.

--emit_warnings_as_errors

Treat all warnings as errors. This option cannot be used with the --no_warnings option. The --diag_remark option takes precedence over this option. This option takes precedence over the --diag_warning option.

--issue_remarks

Issue remarks (non-serious warnings), which are suppressed by default.

--no_warnings

Suppress warning diagnostics (errors are still issued).

--set_error_limit=num

Set the error limit to num, which can be any decimal value. The linker abandons linking after this number of errors. (The default is 100.)

--verbose_diagnostics

Provide verbose diagnostics that display the original source with line-wrap and indicate the position of the error in the source line.

10.4.4.3. Disable Name Demangling (--no_demangle)

By default, the linker uses demangled symbol names in diagnostics. For example:

undefined symbol

first referenced in file

ANewClass::getValue()

test.cpp.o

The --no_demangle option instead shows the linkname for symbols in diagnostics. For example:

undefined symbol

first referenced in file

_ZN9ANewClass8getValueEv

test.cpp.o

For information on referencing symbol names, see tiarmnm - Name Utility. For information specifically about C++ symbol naming, see tiarmdem - C++ Name Demangler Utility.

10.4.4.4. Display a Message When an Undefined Output Section Is Created (--warn_sections)

In a linker command file, you can set up a SECTIONS directive that describes how input sections are combined into output sections. However, if the linker encounters one or more input sections that do not have a corresponding output section defined in the SECTIONS directive, the linker combines the input sections that have the same name into an output section with that name. By default, the linker does not display a message to tell you that this occurred.

You can use the --warn_sections option to cause the linker to display a message when it creates a new output section.

For more information about the SECTIONS directive, see The SECTIONS Directive. For more information about the default actions of the linker, see Default Placement Algorithm.