assembly - Registers modified by systemcall invoked through gcc's extended asm -
i using gcc's extended asm invoke system call. working on proprietary rtos on powerpc (freescale mpc5200b).
according gcc's documentation should add registers assembly code uses - , neither input nor output - clobbers list, because gcc not analyse assembly code , not know registers being altered.
the problem don't know registers system call alters. in fact i'm observing case system call alters register holding pointer. after system call has returned, pointer in register being used, leads invalid memory access.
how should deal situation?
for future readers:
the general answer can find registers altered system call in documentation of system's abi.
for system (freescale mpc5200b) found answer ibm application note 'developing powerpc embedded application binary interface (eabi) compliant programs'.
so added registers marked volatile (namely r3..r12, f0..f13 , flags register) clobbers list.
Comments
Post a Comment