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!
Solved! Go to Solution.
Hi,
quick update - this bug will be fixed in next (ver 1.2) S32DS release - planned for the end of Q1 or beginning of the Q2.
Jiri
Hi,
quick update - this bug will be fixed in next (ver 1.2) S32DS release - planned for the end of Q1 or beginning of the Q2.
Jiri
If the sources would be public available, I could maybe fix it myself.
I think S32DS and GCC should be separated.
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
Hi Jiri,
thanks for filing this as a bug.
But e_or2i is no suitable replacement, as it does not set flags. Same for e_add16i
Cheers
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: