Is there a GCC configuration which will produce an executable only containing ARM32 code?
I know the -marm
switch tells the compiler not to produce Thumb code, but it applies only to the user code of the program, while initialization routines (e.g. _start
, frame_dummy
, ...) still contain Thumb instructions.
I am using the Linaro cross compiler tool-chain (arm-linux-gnueabihf-
) on a Linux x86-64 system.
EDIT :
While recompiling the tool-chain I found the (probable) solution myself. The initialization routines encoded as Thumb are part of glibc and can be found in the object files crt1.o
, crti.o
and crtbegin.o
. I haven't tried recompiling it, but there may be a configuration value which forces the whole libc to be encoded as ARM32.
arm-linux-gnueabihf-gcc
version 5.4.0 (installed from the ubuntu xenial repository). It produces thumb code by default, so the use of the-mthumb
option is not relevant. – Merganser