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 used name and its content have no meaning, other than one NAME can only contain one content. However, multiple pragmas with different NAMEs are legal.
For the linker or the debugger however, the NAME might trigger some special functionality with CONTENT as an argument.
The linker collects the CONTENT for every NAME in different object files and issues a message if a different CONTENT is given for 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 following listing code in a header file used by all compilation units, the linker will issue 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