static symbols and linker

Started by
9 comments, last by frob 10 years, 2 months ago
That is where the "internal linkage", "external linkage", and "no linkage" stuff in the language standard becomes important.


Things with "no linkage" or "internal linkage" are not left as blanks in the object file. The compiler might leave the symbol information in there so the debugger knows where they are, but they are not blanks to be replaced. Only functions with "external linkage" are used for replacement, and there can only be one of those. If there are multiple, or if they are missing, it becomes an error at link time.

If you study the coff and pe formats, you will notice that each module can be relocated at runtime. So yes, each module has addresses relative to its own address space, but they get relocated naturally so that part is taken care of.

This topic is closed to new replies.

Advertisement