Slide 46 of 67
Notes:
Let's focus on the linker command file to understand what it does. The linker command file is a set of instructions that tells linker where to put everything in memory. We have two main sections in the linker command file: the “memory” section, and a “sections” section.
Command line options can be run either from the command invoking the linker, or they can be placed in a batch file. Using a batch file is actually simpler and more repeatable during development, so prior to the memory section of the linker command file, you're allowed to put anything that would otherwise go on the linker command line. Here we included example1.obj, as well as some command line instructions to include this file, create an output file, and create a map file.
Next we have the memory section. Down the left side we see page zero and page one. Page zero is what the linker recognizes as program memory, and page one is what the linker understands to be data memory.
This is a Harvard architecture machine. Therefore, We can name areas in both program memory and data memory. Here, PROM is a name that the developer created. We see it’s starting address and length.We have similar syntax in page one where for SRAM and EPROM. The purpose of the memory section is to define to the linker what the hardware memory map looks like.