Refactor and reorder ld script for cortex-m3.