Symbol table
In computer science, a symbol table is a data structure where each identifier or symbol (referring to variables, constants, procedures, functions, etc.) in a program's code is associated with the necessary information for its functioning. This may come in two main forms: # With object file and executables, the "code" is machine code, and the "information" is typically the memory address of the entity referred to by the symbol. # With language translators such as a compiler or interpreters, the "code" is generally a source code, and the "information" refers to the entry's declaration or appearance in the source. (Interpreters also need a way to find the entry's "value" in the table, often an... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
In computer science, a symbol table is a data structure where each identifier or symbol (referring to variables, constants, procedures, functions, etc.) in a program's code is associated with the necessary information for its functioning. This may come in two main forms: With object file and executables, the "code" is machine code, and the "information" is typically the memory address of the entity referred to by the symbol. With language translators such as a compiler or interpreters, the "code" is generally a source code, and the "information" refers to the entry's declaration or appearance in the source. (Interpreters also need a way to find the entry's "value" in the table, often an address pointing to another data structure.) With intermediate code files, the "information" may be intermediate between the two above types. A symbol table of the second type usually only exists in memory during the translation process. A symbol table of the first type is embedded in the output of the translation, such as in an ABI object file for later use. For example, it might be used when loading a dynamic library, during an interactive debugging session, or as a resource for formatting a diagnostic report during or after execution of a program. ===Applications=== An object file will contain a symbol table of the identifiers it contains that are externally visible. During the linking of different object files, a linker will identify and resolve these symbol references. Usually all undefined external symbols will be searched for in one or more object libraries. If a module is found that defines that symbol it is linked together with the first object file, and any undefined external identifiers are added to the list of identifiers to be looked up. This process continues until all external references have been resolved. It is an error if one or more remains unresolved at the end of the process. While reverse engineering an executable, many tools refer to the symbol table to check what addresses have been assigned to global variables and known functions. If the symbol table has been stripped or cleaned out before being converted into an executable, tools will find it harder to determine addresses or understand anything about the program. // Declare an external function extern double bar(double x); // Define a public function double foo(int count) { double sum = 0.0; // Sum all the values bar(1) to bar(count) for (int i = 1; i The object file would consist of at least two things: an address of the function and a way indicating usage of . ==See also== Debug symbol .debug_info ==References== ==Bibliography==
Cite this
"Symbol table". 1787496958. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1370898126 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy