Function
#pragma LINK_INFO NAME "CONTENT"
None
NAME: Identifier specific to the purpose of this LINK_INFO.
CONTENT: C-style string containing only printable ASCII characters.
None
This pragma instructs the compiler to put the passed name content pair into the ELF file. For the compiler, the name that is used and its content have no meaning other than each name can contain only one content string. However, multiple pragmas with different NAMEs are legal.
For the Linker or for the Debugger, however, NAME might trigger some special functionality with CONTENT as an argument.
The Linker collects the CONTENT for every NAME from different object files and issues a message if CONTENT differs in different object files.
Apart from extended functionality implemented in the Linker or Debugger, this feature can also be used for user-defined link-time consistency checks.
Using the code shown in the following listing in a header file used by all compilation units, the Linker issues a message if the object files built with _DEBUG are linked with object files built without it.
#ifdef _DEBUG #pragma LINK_INFO MY_BUILD_ENV DEBUG #else #pragma LINK_INFO MY_BUILD_ENV NO_DEBUG #endif