Skip to content

Commit

Permalink
ARC: handle gcc generated __builtin_trap for older compiler
Browse files Browse the repository at this point in the history
ARC gcc prior to GNU 2018.03 release didn't have a target specific
__builtin_trap() implementation, generating default abort() call.

Implement the abort() call - emulating what newer gcc does for the same,
as suggested by Arnd.

Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: Vineet Gupta <[email protected]>
  • Loading branch information
vineetgarc committed Jan 3, 2018
1 parent f5a16b9 commit af1be2e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/arc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,11 @@ void do_insterror_or_kprobe(unsigned long address, struct pt_regs *regs)

insterror_is_error(address, regs);
}

/*
* abort() call generated by older gcc for __builtin_trap()
*/
void abort(void)
{
__asm__ __volatile__("trap_s 5\n");
}

0 comments on commit af1be2e

Please sign in to comment.