栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > C++面试题库

Compiler Related Questions

Compiler Related Questions

Q: Dynamic linking vs Static linking (Yahoo! PhoneScreen)
A:
1.    Dynamic linking: resolve references to lib routines, linker adds start-up code to load required libs at run-time, each lib call goes through a jump table. A jump table is patched to point at the lib routine, only overhead here is indirect reference.
2.    Static linking:  linted into program during linking phase of compilation
3.    Dynamic linking: verifies symbols linkage, dynamic loader checks which shared libs were linked with the program, loads to memory and attach to the program memory.

Example:
ar –s  is (ranlib)
ar –rc *.a *.o

g++ -shared –o lib*.so *.o
g++ -fPIC –c *(.c
ld –lc –o lib*.so *.o

Q:  What is Relocation?  (Yahoo! Phone Screen)
A:  allowing executable and shared obj fiels to hold right info for a process’ program image. It is the process of connecting symbolic ref with symbolic defs. ELF header, program header and section header.

Q:  C++ vfpointer and vftable?
A:  virtual function table and virtual function table. Whenever there is virtual function in class definitions, these 2 things are needed for dynamic-binding(polymorphism)

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/265823.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号