iPXE
Macros
Macros to provide or require explicit symbols

Macros

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

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:18

Provide a symbol within this object file.

Parameters
symbolSymbol name

Definition at line 84 of file compiler.h.

◆ REQUEST_SYMBOL

#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.

◆ REQUIRE_SYMBOL

#define REQUIRE_SYMBOL (   symbol)
Value:
__asm__ ( ".reloc __requiring_symbol__, " \
_S2 ( RELOC_TYPE_NONE ) ", " #symbol )
#define _S2(x)
Stringify expanded argument.
Definition: compiler.h:53
#define RELOC_TYPE_NONE
Dummy relocation type.
Definition: compiler.h:7
__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")

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.

◆ REQUIRING_SYMBOL

#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.

◆ 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
__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")

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.