Hopefully it’s just that.
I doubt it. My specs.txt file for xc16 has only a 0x0A (linux, created with kwrite), which works.
I would suspect something wrong with the global option-
-specs=specs.txt
although if something was wrong, the compiler would start complaining (you did add that option, right?)
You should be able to run this script (option 3) on a Mac
if not, then my opinion of Mac OS just went down
need- terminal- bash (or similar), objdump, grep, xxd, sed
get to terminal in this directory-
/opt/microchip/xc16/v1.33/bin/bin/
(not sure, maybe Mac uses something else, adjust as needed)
copy and paste this script-
for f in elf-cc1 coff-cc1; do
[ -e $f.bak ] || cp $f $f.bak
a=$(objdump -T $f | grep mchp_mafrlcsj)
a=${a:6:2}${a:4:2}${a:2:2}${a:0:2}
b=$(objdump -t elf-cc1 | grep gcc_version)
b=${b:6:2}${b:4:2}${b:2:2}${b:0:2}
old="\(8b..\)${a}"
new="\1${b}"
xxd -ps $f.bak | sed "s:$old:$new:" | xxd -r -p - $f
done
summary-
line1- just simply do for each of these 2 files (nobody probably uses coff file, though)
line2- if backup copy not previously made, make one
line3- using objdump, get address of mchp_mafrlcsj
line4- convert address to little-endian
line5- using objdump, get address of gcc_version
line6- convert to little-endian
line7- create var for sed search- 8b..address of mchp_mafrlcsj
line8- create replacement var for sed- 8b..address of gcc_version
line9- dump file into sed as hex, replacing first (only) instance of match, dump back out to binary
line10- done
You can also use a hex editor on elf-cc1-
you need the address of mchp_mafrlcsj so you have something to search for (address is little-endian)
option1- replace the address of the mov instruction target from mchp_mafrlcsj to gcc_version
(need both addresses, from objdump)
option2- replace the jne soon after the mov to je (I think 0f 85 to 0f 84)