Hi
there is a bug in the linker doing symbol fixup.
I have following code:
e_lis r2,ext_label@ha
e_add2i. r2,ext_label@l
The generated opcodes are correct, but after linking (I guess it depend on the actual value of the label) I get (here it is 0xb0c):
e_lis r2, 0
e_add2i. r18,0x30c
----------------
The linker does simply replace the low-word of the opcode by "0xb0c", but the immediate is spread all over the opcode!
已解决! 转到解答。
Hi,
thank you a lot for your discovery and report - I can confirm that this is a bug and for e_add2i. instruction is generated bad opcode (bad target register address). I'm going to create ticket for compiler team.
As a workaround you can use OR instruction instead ADD:
e_lis r4, ext_label@h
e_or2i r4, ext_label@l
Jiri
Another fix-up bug:
In my code, sc_modules is a 0x400000000 (internal RAM)
e_add2is r4,sc_modules@ha
The linker produces
e_add2is r4,0x2000
So far, PowerPC GCC for VLE is not really usable. :smileysad: