www.delorie.com/gnu/docs/dld/dld_13.html   search  
Buy GNU books!


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.8 Explicitly Defining a Symbol

Dld allows a programmer to explicitly define global symbols. That is, a programmer can force a symbol to have storage assigned for it. This is especially useful in incremental program testing where the function being tested needs to access some global variables which are defined by another function not yet linked in (or even not yet written). There are two functions related to explicit definition:

Function: int dld_define_sym (const char *name, unsigned int size)
dld_define_sym forces dld to allocate size bytes for symbol name. It can be called before or after a reference to name is made. If references to name already exist when it is defined, all such references are directed to point to the correct address allocated for name.

dld_define_sym returns 0 if successful. Otherwise, it returns a non-zero error code (see section Definition of Error Codes). The typical error is a multiple definition of name.

Function: void dld_remove_defined_symbol (const char *name)
When the definition of name is no longer needed, it can be removed by dld_remove_define_symbol.

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003