Tuesday, January 4, 2011

symbol interposistion

在這裡有講到 symbol interposition
http://www.airs.com/blog/archives/307

就是相同的definition存在時 linker是怎麼決定要用哪一個的

elf的specification裡提到
p82 2-12
http://refspecs.freestandards.org/elf/elf.pdf


When resolving symbolic
references, the dynamic linker examines the symbol tables with a breadth-first search. That is,
it first looks at the symbol table of the executable program itself, then at the symbol tables of
the DT_NEEDED entries (in order), then at the second level DT_NEEDED entries, and so on.
Shared object files must be readable by the process;

這裡講的是dynamic linker ,所以是dynamic linking 而不是static linking

如果是static linking 的話  就會有什麼redefined 的error出來了




No comments: