No compilation errors more.
and one theoretical question: if we change some "illegal" for this assembler instructions like BLX R12 to their opcodes (.long 0xE12FFF3C), this can work? (of course, instruction must do not contain relative to PC offsets (like LDR))
I'm sorry, I completely missed this question. Anyway, as I documented (don't know if you read that), I compiled an extra compiler without the --with-cpu=arm9 flag. This causes the compiler to use the default ARM cpu, I don't really know which one. It just seems that 'arm9' does not support BLX Rn or STRD (among a few others), but the camera does. I verified this by checking the opcode from the original firmware bit-by-bit and 'my' compiler generated the exact same opcode as in the camera, so I'd say using the direct opcode would work (though the assembler might complain). I also did see a distinct difference between BLX R12 and MOV LR, PC + MOV PC, R12 in the generated code, but the behaviour was identical (unless R12 has a thumb-address), so it works. I also did not notice any new errors being introduced after switching back to the 'official' compiler.
I accidentally discovered this because I was too lazy to actually compile a 'chdk-gcc', so I used the toolchain I use for my iPod. This one had some problem with floating-point math, causing the camera to crash, so I had to build a new toolchain anyway. I just hated that compiler lying to me so I found this way to create a compiler which has the correct fp-math things and doesn't whine about those instructions.
As far as code is concerned, I think (or remember from documentation) the --with-cpu=arm9 is a flag which only tells the ASSEMBLER what architecture to assemble for. Both compilers gave me an identical BOOTDISK.BIN, at least in filesize. I didn't checksum them or whatever. I think it's safe to use the compiler with this flag but obviously more models have to be tested and everyone has to agree. For now, I'm fine with this workaround, the BLX opcodes should never be called from thumb (CHDK) anyway, as far as I've discovered them.
Edit: commit done, binary version updated.