11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 5Linker and Utilities5.1 IntroductionHI-TECH C incorporates a relocating assembler and linker to permit separate compilation of Csource files. This means that a program may be divided into several source files, each of whichmay be kept to a manageable size for ease of editing and compilation, then each source file may becompiled separately and finally all the object files linked together into a single executable program.This chapter describes the theory behind and the usage of the linker. Note however that in mostinstances it will not be necessary to use the linker directly, as the compiler drivers (HPD or commandline) will automatically invoke the linker with all necessary arguments. Using the linker directly isnot simple, and should be attempted only by those with a sound knowledge of the compiler andlinking in general.If it is absolutely necessary to use the linker directly, the best way to start is to copy the linkerarguments constructed by the compiler driver, and modify them as appropriate. This will ensure thatthe necessary startup module and arguments are present.Note also that the linker supplied with HI-TECH C is generic to a wide variety of compilers forseveral different processors. Not all features described in this chapter are applicable to all compilers.5.2 Relocation and PsectsThe fundamental task of the linker is to combine several relocatable object files into one. Theobject files are said to be relocatable since the files have sufficient information in them so that anyreferences to program or data addresses (e.g. the address of a function) within the file may beadjusted according to where the file is ultimately located in memory after the linkage process. Thus89

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!