This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ELF entry point in thumb mode (armv7/aarch32)

Hi !

We are writing an OS targeting 32 bits ARM platform, where binaries can be compiled in ARM or in Thumb mode.

At the moment, to execute a new process, I load the info from an ELF, set lr_usr to the entry point address, set spsr_usr to a default value (USER mode + I/F/A unmasked) and perform a 'movs pc, lr' to go to user mode.

So far, I only compiled my application in ARM mode. What if the ELF was compiled in thumb mode ?

I'm thinking about testing bit 0 of the entry point, and if it is set, add the T bit to spsr_usr, before executing the 'movs pc, lr' command.

Do I have to do this explicitly or will this be done by the movs pc, lr (because bit 0 of lr is 1) and I can ignore the T bit of the SPSR ?

Best regards,

V.