iPXE
Macros to provide or require explicit symbols

Macros

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

Detailed Description

Macro Definition Documentation

◆ PROVIDE_SYMBOL

#define PROVIDE_SYMBOL ( symbol)
Value:
char symbol[0] \
__attribute__ (( section ( ".provided" ) ))
struct netvsc_rx_buffer_section section[1]
Section descriptors.
Definition netvsc.h:7

Provide a symbol within this object file.

Parameters
symbolSymbol name

Definition at line 84 of file compiler.h.

84#define PROVIDE_SYMBOL( symbol ) \
85 char symbol[0] \
86 __attribute__ (( section ( ".provided" ) ))

◆ REQUEST_SYMBOL

#define REQUEST_SYMBOL ( symbol)
Value:
__asm__ ( ".equ __request_" #symbol ", " #symbol )
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")

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.

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

◆ REQUIRE_SYMBOL

#define REQUIRE_SYMBOL ( symbol)
Value:
__asm__ ( ".reloc __requiring_symbol__, " \
_S2 ( RELOC_TYPE_NONE ) ", " #symbol )
#define RELOC_TYPE_NONE
Dummy relocation type.
Definition compiler.h:7
#define _S2(x)
Stringify expanded argument.
Definition compiler.h:53

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.

121#define REQUIRE_SYMBOL( symbol ) \
122 __asm__ ( ".reloc __requiring_symbol__, " \
123 _S2 ( RELOC_TYPE_NONE ) ", " #symbol )

◆ REQUIRING_SYMBOL

#define REQUIRING_SYMBOL ( symbol)
Value:
__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.

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

◆ PROVIDE_REQUIRING_SYMBOL

#define PROVIDE_REQUIRING_SYMBOL ( )
Value:
__asm__ ( ".section \".tbl.requiring_symbols\", " \
" \"a\", " PROGBITS "\n" \
"__requiring_symbol__:\t.byte 0\n" \
".size __requiring_symbol__, " \
" . - __requiring_symbol__\n" \
".previous" )
#define PROGBITS
Definition compiler.h:61

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.

158#define PROVIDE_REQUIRING_SYMBOL() \
159 __asm__ ( ".section \".tbl.requiring_symbols\", " \
160 " \"a\", " PROGBITS "\n" \
161 "__requiring_symbol__:\t.byte 0\n" \
162 ".size __requiring_symbol__, " \
163 " . - __requiring_symbol__\n" \
164 ".previous" )