From d1dcdb8886370ea1fc348417c0d934e0f4243beb Mon Sep 17 00:00:00 2001 From: Anton Kolesov Date: Fri, 13 May 2016 18:21:08 +0300 Subject: [PATCH] arc: Have nops in _exit_halt only for ARCompact ARCompact processors (ARC 600 and ARC 700) require three "nop"s after the "flag 1" instruction. Later ARC processors do not have this requirement, so it is possible to reduce size of "_exit_halt" for them. libgloss/ 2016-05-24 Anton Kolesov * arc/crt0.S (_exit_halt): Insert nops only for ARCompact. --- libgloss/arc/crt0.S | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/libgloss/arc/crt0.S b/libgloss/arc/crt0.S index 1d966c211..7db07fff0 100644 --- a/libgloss/arc/crt0.S +++ b/libgloss/arc/crt0.S @@ -207,15 +207,18 @@ __start: ; r0 contains exit code j @exit - .section .text._exit_halt,"ax",@progbits - .global _exit_halt - .type _exit_halt, @function +.section .text._exit_halt,"ax",@progbits +.global _exit_halt +.type _exit_halt, @function _exit_halt: ; r0 contains exit code - flag 0x01 + flag 1 +#if defined (__ARC600__) || defined (__ARC700__) + ; ARCompact requires 3 nops after flag 1 nop - nop ; ARCompact requires 3 nops after flag 1 nop + nop +#endif b @_exit_halt - nop +.balign 4