I'm currently having a hard time understanding the linking/loading concept.
Could you tell me if following statements on the use of the symbol and relocation tables are correct?
Thanks for your time!
extern
elements being required) is correct. The corollary about programs consisting of a single object file, however, is not entirely true: at least one symbol must be available for external use - namely, the entry point (the main
function of a C program) must be visible.address
means different things in different contexts here, it is preferable to talk about offsets, not addresses, inside the file. Relocation table holds offsets to everything that needs to be updated when the file is loaded into memory, along with information of what needs to be written to these offsets.