Error: unaligned opcodes detected in executable segment

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

Error: unaligned opcodes detected in executable segment

4,222件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by IanB on Tue Jun 16 10:53:41 MST 2015
I know what this means, but why are there unaligned opcodes? and how do I align them?
0 件の賞賛
返信
3 返答(返信)

2,861件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by IanB on Wed Jun 17 23:18:15 MST 2015
Spot on - many thanks - I knew it was something like that, but couldn't find exactly what.
I'd .included some text messages for an LCD display in a .text section instead of a .rodata section.
I thought I had enough  .align commands to deal with it, but perhaps I needed just one more!

0 件の賞賛
返信

2,861件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Tue Jun 16 11:27:30 MST 2015
You give absolutely no reference information!

Cortex M0 and M3 have 16-bit wide opcodes which must be aligned on a half-word boundary.
I.e. at even addresses.

There are some 32-bit opcodes also, but they too only need to be half-word aligned.

One guess is that you have some data (as opposed to code) that is being allocated in an executable
section by some mistake of yours and that the bit patterns of the data match that of executable code.

Or, perhaps you have some assembler code with  an odd number of '.byte' directives, or a string of odd length.
The .align ... directive should then be used to align the code base. (The assember manual is accessibe from the help menu.)
Or maybe you have 'asm' escapes in your "C" code. The same applies.

The link map can be your friend here.

Mike
0 件の賞賛
返信

2,861件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Tue Jun 16 11:18:01 MST 2015
Broken linker script? If you want any more help, you are going to have to provide more information.
0 件の賞賛
返信