9.4 Using Custom Linker Scripts in MPLAB X IDE Projects
The standard default 32-bit linker scripts are general purpose and will satisfy the demands of most applications. However, an occasion may arise where a custom linker script is required.
A good way to accomplish this is to copy the default linker script (see Section Mapping) for your device into
your project tree under “Linker Files” and make the required modifications to that file.
The default script can be found by linking your project without a custom script and noting
in the output which script is being used. Upon linking your project, the linker prints the
name and path of the linker script that is currently being used. Use this to confirm that
your script is being selected. Customizations that you make to your new *.ld file will be reflected in subsequent builds.
You may wish to retain unused sections in a custom linker script, since unused sections will not impact application memory usage. If a section must be removed for a custom script, C style comments can be used to disable it.
