next up previous
Next: Library locations and Up: ELF under Linux Previous: ELF under Linux

ELF macros

In <gnu-stabs.h>, we defined a few macros which can be used to manipulate the symbols.

elf_alias(name1, name2)

Defines an alias name2 for the symbol name1. It should be used in the file where the symbol name1 is defined.
weak_alias(name1, name2)

Defines a weak alias name2 for the symbol name1. The linker will use name1 to resolve the reference to name2 only if name2 is not defined anywhere else. It should also be used in the file where the symbol name1 is defined.
elf_set_element(set, symbol)

Forces symbol becomes an element of set. A new section is created for each set.
symbol_set_declare (set)

Declares set for use in this module. It actually decalres two symbols:

symbol_set_first_element(set)

Returns a pointer (void *const *) to the first element of set.
symbol_set_end_p(set, ptr)

Returns true if and only if ptr (a void *const *) has been incremented past the last element in set.

Using these macros, programmers can create lists from different sources file at will.



J.H.M.Dassen
Tue Aug 1 14:18:10 MDT 1995