Difference between revisions of "Symbol"

From CDOT Wiki
Jump to: navigation, search
(Created page with 'Category:Computer Architecture A ''symbol'' is a name for a variable, address, register, or instruction. These are usually numerically at the [[Machine Language|machine code]…')
 
Line 1: Line 1:
 
[[Category:Computer Architecture]]
 
[[Category:Computer Architecture]]
A ''symbol'' is a name for a variable, address, register, or instruction. These are usually numerically at the [[Machine Language|machine code]] level.
+
A ''symbol'' is a ''name'' for a variable, address, register, or instruction.
  
 
For example, the symbol "a" is used in this C code:
 
For example, the symbol "a" is used in this C code:
Line 6: Line 6:
 
  int a=5;
 
  int a=5;
  
In the compiled code, the name of the variable is insignificant -- the object code will access the relevant memory location by address.
+
In the compiled code, the name of the variable is insignificant -- the object code will access the relevant memory location by address at the [[Machine Language|machine code]] level.
  
 
Symbolic information is generally lost during compilation, unless it is specifically preserved by the compiler. Most C compilers use the <code>-g</code> option to request that symbol information be attached to the binary for debugging purposes; a [[Debugger|debugger]] or [[Disassembler|disassembler]] can use this information to convert addresses and other numeric information to a symbolic representation. (Debug information may also include code-address-to-source-line-number cross reference data so that errors, code listings, and single-step operations can display or refer to the relevant source code).
 
Symbolic information is generally lost during compilation, unless it is specifically preserved by the compiler. Most C compilers use the <code>-g</code> option to request that symbol information be attached to the binary for debugging purposes; a [[Debugger|debugger]] or [[Disassembler|disassembler]] can use this information to convert addresses and other numeric information to a symbolic representation. (Debug information may also include code-address-to-source-line-number cross reference data so that errors, code listings, and single-step operations can display or refer to the relevant source code).
  
 
In order to reduce the size of distributed binaries, symbolic debug data may be separated from the binary and placed in another file. This can be accessed from a local file, or a ''symbol server'' set up for this purpose.
 
In order to reduce the size of distributed binaries, symbolic debug data may be separated from the binary and placed in another file. This can be accessed from a local file, or a ''symbol server'' set up for this purpose.

Revision as of 17:15, 14 January 2014

A symbol is a name for a variable, address, register, or instruction.

For example, the symbol "a" is used in this C code:

int a=5;

In the compiled code, the name of the variable is insignificant -- the object code will access the relevant memory location by address at the machine code level.

Symbolic information is generally lost during compilation, unless it is specifically preserved by the compiler. Most C compilers use the -g option to request that symbol information be attached to the binary for debugging purposes; a debugger or disassembler can use this information to convert addresses and other numeric information to a symbolic representation. (Debug information may also include code-address-to-source-line-number cross reference data so that errors, code listings, and single-step operations can display or refer to the relevant source code).

In order to reduce the size of distributed binaries, symbolic debug data may be separated from the binary and placed in another file. This can be accessed from a local file, or a symbol server set up for this purpose.