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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Linker and UtilitiesLink and load addressessource level, this means all names which have storage class external and which are not declaredas static. These symbols may be referred to by modules other than the one in which they aredefined. It is the linker’s job to match up the definition of a global symbol with the references to it.Other symbols (local symbols) are passed through the linker to the symbol file, but are not otherwiseprocessed by the linker.5.6 Link and load addressesThe linker deals with two kinds of addresses; link and load addresses. Generally speaking the linkaddress of a psect is the address by which it will be accessed at run time. The load address, whichmay or may not be the same as the link address, is the address at which the psect will start within theoutput file (HEX or binary file etc.). In the case of the 8086 processor, the link address roughly correspondsto the offset within a segment, while the load address corresponds to the physical addressof a segment. The segment address is the load address divided by 16.Other examples of link and load addresses being different are; an initialised data psect that iscopied from ROM to RAM at startup, so that it may be modified at run time; a banked text psect thatis mapped from a physical (== load) address to a virtual (== link) address at run time.The exact manner in which link and load addresses are used depends very much on the particularcompiler and memory model being used.5.7 OperationA command to the linker takes the following form:hlink 1 options files ...Options is zero or more linker options, each of which modifies the behaviour of the linker in someway. Files is one or more object files, and zero or more library names. The options recognised bythe linker are listed in Table 5.1 and discussed in the following paragraphs.Table 5.1: Linker command-line optionsOptionEffect-8 Use 8086 style segment:offset address form-Aclass=low-high,... Specify address ranges for a classcontinued. . .1 In earlier versions of HI-TECH C the linker was called LINK.EXE91

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

Saved successfully!

Ooh no, something went wrong!