Microchip Technology SW006023-2N Data Sheet

Page of 238
MPLAB
®
 XC32 C/C++ Compiler User’s Guide
DS51686E-page 176
 2012 Microchip Technology Inc.
17.4
DEFAULT LINKER SCRIPT
The default linker script is located in the 
<install-directory>/pic32mx/lib/ldscripts/elf32pic32mx.x
 file. 
When compiling with the xc32-gcc or xc32-g++ compilation driver, the linker uses this 
file as the default linker script. The driver passes the path to the default linker script 
using the -T linker option.
The default linker script contains the following categories of information:
17.4.1
Output Format and Entry Points
The first several lines of the default linker script define the output format and the entry 
point for the application. Copies of the default linker scripts are provided in 
program files/.../<install-dir>/pic32mx/lib/ldscripts
.
OUTPUT_FORMAT("elf32-tradlittlemips")
OUTPUT_ARCH(pic32mx)
ENTRY(_reset)
The OUTPUT_FORMAT line selects the object file format for the output file. The output 
object file format generated by the 32-bit language tools is a traditional, little-endian, 
MIPS, ELF32 format.
The OUTPUT_ARCH line selects the specific machine architecture for the output file. 
The output files generated by the 32-bit language tools contain information that 
identifies the file was generated for the PIC32MX architecture.
The ENTRY line selects the entry point of the application. This is the symbol identifying 
the location of the first instruction to execute. The 32-bit language tools begins 
execution at the instruction identified by the _reset label.
Note:
All addresses specified in the linker scripts should be specified as virtual 
addresses, not physical addresses.