0

I'm interested in how implements that an appropriate name bind to a specify entity in the compiler internal (g++ in my case). Is there exist something like symbol table recorded every name and a corresponding entity depends on scope in which name appeared?

St.Antario
  • 26,175
  • 41
  • 130
  • 318

1 Answers1

2

Of course, compilers construct the symbol table in order to determine, name, type and scope. It's depends on the output format, but those symbol tables can be 'burnt' into the file, so that linker can resolve any external references.

For example, when you use printf() the compiler does not know anything about it, however the linker can resolve it appropriately through linking it with the C standard library.

This question addresses how to access that symbol table in the ELF format (standard on Linux systems) . Accessing ELF symbol table in C

Community
  • 1
  • 1
Andro
  • 2,232
  • 1
  • 27
  • 40