Search code examples
compiler-constructionbackendsymbol-table

Compiler : How is symbol table passed from source machine to target machine?


Symbol table is used by both front-end and back-end but how is the symbol table passed to back-end assuming that target code will run on a different machine? Would it be somehow "attached" to the intermediate representation or will it be included in the instance of logical address space?


Solution

  • The symbol table for linking is placed in the intermediate object-code file, with extension such as .o or .obj, depending on platform. See the article titled Object file for an overview and other links. Not only is there a symbol table there, but also things like relocation tables and dynamic link data, basically everything needed to ultimately get the code loaded into system RAM and executing.