Firewing version 184.108.40.206 introduced optional linker script support for PIC24 and PIC32 devices. You can set the linker script in your program using the #option directive at the top of your program (and below any device or clock statements). For example,
device = 32MX150F128B clock = 40 #option _gccLink = "c:\my_linker_scripts\linker-script.ld"
A good example of using a linker script is when building using the XC32 toolsuite. If you program the *.hex file into a Firewing board, it won't work. This is because the default linker script used by the Microchip compiler assumes no bootloader is being used. The XC32 toolsuite has a sample script file which enables you to build and program directly into a Firewing board. For example,
#option _gccLink = "<fw-install-dir>\Bin\Toolsuite\microchip32\linker\bootload-32MX150F128B.ld"
Just replace <fw-install-dir> with the path to your Firewing installation. In some cases, you may just want the linker script to be used for a certain toolsuite. For example, when building using the XC32 toolsuite you might want to use a linker script but not when using the native Firewing 32 compiler:
#if _toolsuite = microchip_32 #option _gccLink = "<path-to-linker>\32MX150F128B.ld" #endif