Spotted a bug in the linker script. It needed a * after the "chip" as well in the chip section so it reads:
*(*chip*)
. Without this, it was not pulling in sections with generated names like "codechip0001"
Code:
PHDRS {
fast PT_LOAD;
chip PT_LOAD;
}
SECTIONS {
. = 0x400;
.chip: {
*(*chip*)
. = ALIGN(2);
_FREECHIP = .;
} :chip
. = 0x100000;
.text: { *(code*) } :fast
.data: { *(data*) }
.sdata: {
_LinkerDB = . + 0x7ffe;
_SDA_BASE_ = . + 0x7ffe;
*(.sdata __MERGED)
}
.bss: { *(bss*) }
}
However this now results in:
Warning 22: Attributes of section .chip were changed from r-x- to rwx- in hunk_to_rawseg_loadfile.