[Question from newbie on DHCP server code]

Ted Lemon Ted.Lemon at nominum.com
Mon Jul 21 17:32:41 UTC 2008


On Jul 20, 2008, at 6:01 PM, LE Haï-Binh wrote:
> Firstly, in the server code, I found a weird thing called MDL which  
> is not mentioned anywhere in the code. What does it mean?

It's just a macro that's replaced with the file and line number, for  
debugging.   I'm not sure where it's defined, but if you grep in the  
headers/ directory, I'm sure you will find it.

> Secondly, I've found plenty of source code files and a complicated  
> relationship amongst them. Can you in brief tell me how the C  
> compiler can do such a pretty work to make this project run  
> perfectly? I mean, if the compiler meet a function that does not  
> defined in a file .c, how can it find the code for this function?  
> (It would be a stupid question for even the beginners but i'm  
> totally new to this stuff :-)).

The C compiler produces a relocatable object file, which contains a  
list of all the symbols it defines, and a list of all the symbols that  
it found when compiling that weren't defined.   Then the linker  
collects all the object files in the project and connects the symbols  
defined in each object file to the object files that refer to them.    
The linker produces a single file, called the executable, that  
contains all the object files linked together.   So it's a two-step  
process - compile each individual file first, then link them all  
together.



More information about the dhcp-users mailing list