0
votes

we are using cortex A15, and kernel 3.8. If I compile arm-gcc-4.7.3 test.c -o test_thumb -mthumb

In Kernel if I set CONFIG_ARM_THUMB or unset. my THUMB(user space) always run,

So i could not understand the behavior.

1

1 Answers

1
votes

Ok, so, I can't see a good reason to do what you're attempting to do ... so I'll assume you are asking out of pure curiosity.

It is not possible (in the processor) to disable decoding Thumb instructions or switching to Thumb state. The CONFIG_ARM_THUMB option is about making the use of Thumb code in applications safe with regards to how the operating system acts. This means, on the theoretical level, that not having this disabled could mean that in certain situations the program would not work properly - not that it would prevent actively Thumb code from executing.

In practise, the main effect it ever had was with OABI, which used an embedded value in the SWI (now SVC) instruction to identify which system call it was requesting. I think OABI is not even supported by latest versions of GCC/binutils... Any 4.7 toolchain is highly likely to be EABI.