S32DS PowerPC 1.1: Serious linker bug

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32DS PowerPC 1.1: Serious linker bug

Jump to solution
1,415 Views
bastian_schick
Contributor IV

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!

Labels (1)
Tags (3)
1 Solution
1,203 Views
jiri_kral
NXP Employee
NXP Employee

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 

View solution in original post

5 Replies
1,204 Views
jiri_kral
NXP Employee
NXP Employee

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 

1,203 Views
bastian_schick
Contributor IV

If the sources would be public available, I could maybe fix it myself.

I think S32DS and GCC should be separated.

0 Kudos
1,203 Views
jiri_kral
NXP Employee
NXP Employee

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

1,203 Views
bastian_schick
Contributor IV

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

0 Kudos
1,203 Views
bastian_schick
Contributor IV

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:

0 Kudos