iPXE
Defines
Macros to provide or require explicit symbols

Defines

#define PROVIDE_SYMBOL(symbol)
 Provide a symbol within this object file.
#define REQUEST_SYMBOL(symbol)   __asm__ ( ".equ __request_" #symbol ", " #symbol )
 Request a symbol.
#define REQUIRE_SYMBOL(symbol)
 Require a symbol.
#define REQUIRING_SYMBOL(symbol)   __asm__ ( ".equ __requiring_symbol__, " #symbol )
 Specify the file's requiring symbol.
#define PROVIDE_REQUIRING_SYMBOL()
 Provide a file's requiring symbol.

Define Documentation

#define PROVIDE_SYMBOL (   symbol)
Value:
char symbol[0]                                          \
          __attribute__ (( section ( ".provided" ) ))

Provide a symbol within this object file.

Parameters:
symbolSymbol name

Definition at line 84 of file compiler.h.

#define REQUEST_SYMBOL (   symbol)    __asm__ ( ".equ __request_" #symbol ", " #symbol )

Request a symbol.

Parameters:
symbolSymbol name

Request a symbol to be included within the link. If the symbol cannot be found, the link will succeed anyway.

Definition at line 101 of file compiler.h.

#define REQUIRE_SYMBOL (   symbol)
Value:
__asm__ ( ".reloc __requiring_symbol__, "               \
                  _S2 ( RELOC_TYPE_NONE ) ", " #symbol )

Require a symbol.

Parameters:
symbolSymbol name

Require a symbol to be included within the link. If the symbol cannot be found, the link will fail.

To use this macro within a file, you must also specify the file's "requiring symbol" using the REQUIRING_SYMBOL() or PROVIDE_REQUIRING_SYMBOL() macros.

Definition at line 121 of file compiler.h.

#define REQUIRING_SYMBOL (   symbol)    __asm__ ( ".equ __requiring_symbol__, " #symbol )

Specify the file's requiring symbol.

Parameters:
symbolSymbol name

REQUIRE_SYMBOL() works by defining a dummy relocation record against a nominated "requiring symbol". The presence of the nominated requiring symbol will drag in all of the symbols specified using REQUIRE_SYMBOL().

Definition at line 140 of file compiler.h.

Value:
__asm__ ( ".section \".tbl.requiring_symbols\", "       \
                  "         \"a\", " PROGBITS "\n"              \
                  "__requiring_symbol__:\t.byte 0\n"            \
                  ".size __requiring_symbol__, "                \
                  "      . - __requiring_symbol__\n"            \
                  ".previous" )

Provide a file's requiring symbol.

If the file contains no symbols that can be used as the requiring symbol, you can provide a dummy one-byte-long symbol using PROVIDE_REQUIRING_SYMBOL().

Definition at line 158 of file compiler.h.