Symbol tables centralize information and reduce program size by associating symbols with larger pieces of information. They are used in compiling code and linking libraries, allowing multiple programs to access the same data and reducing overall program size.
A symbol table is used by computer systems as a means of centralizing information and reducing the size of programs. These tables work like the key to a secret code; a symbol or string is placed next to another piece of information, usually much larger. When a program reads a symbol associated with the symbol table, the program references the table and gets the information instead of the symbol. This allows large pieces of information or commonly repeating structures to have a single entry, reducing the overall program size.
The concept behind a symbol table is very simple. A single table contains a variety of information used by a program, each with its own entry and unique associated symbol. This information could be strings of code, debug information, memory locations, literally anything the program could use to run. Instead of including that information within the program, the code simply references the table using its unique symbol.
There are two places a symbol table is common: in compiling code into programs and in linking libraries used by multiple programs. When used in programs, the actual table is typically absorbed into the program or turned into a shared library at compile time. It is unusual to leave the list separate, as changing the list could have extreme consequences for the program. Even when the table is transformed in this process, it’s still the same basic thing, it’s just included along with other code.
When a symbol table is used in a link library, the possibilities of how it can work expand dramatically. A link library is a set of information that is assumed to be available to a program at all times. These libraries are often shared by an operating system or a family of related programs, all made by the same company.
Each of these libraries is filled with information on certain topics. One library may contain a variety of programs for drawing the borders of the operating system user interface window, while another may contain information about where a specific group of programs store information in memory. Because a link library can contain such a random assortment of information, symbol tables are often included with them.
By embedding a symbol table in a linker, symbols can be shared across a number of programs. This allows multiple programs to access the same data at any time. If a large number of programs all require the same information, including it within a symbol table in a library greatly reduces the size of the total program group.
Protect your devices with Threat Protection by NordVPN