S32DS PowerPC 1.1: Serious linker bug

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32DS PowerPC 1.1: Serious linker bug

ソリューションへジャンプ
2,538件の閲覧回数
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!

ラベル(1)
タグ(3)
1 解決策
2,326件の閲覧回数
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 

元の投稿で解決策を見る

5 返答(返信)
2,327件の閲覧回数
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 

2,326件の閲覧回数
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 件の賞賛
返信
2,326件の閲覧回数
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

2,326件の閲覧回数
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 件の賞賛
返信
2,326件の閲覧回数
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 件の賞賛
返信