Code Search for Developers
 
 
  

linux-crt0.c from Gdb at Krugle


Show linux-crt0.c syntax highlighted

/** Linux startup code for the ARM processor.
 * Written by Shaun Jackman <sjackman@gmail.com>.
 * Copyright 2006 Pathway Connectivity
 *
 * Permission to use, copy, modify, and distribute this software
 * is freely granted, provided that this notice is preserved.
 */

#include <stdlib.h>
#include <unistd.h>

static int _main(int argc, char *argv[]) __attribute__((noreturn));

#if __thumb__ && !__thumb2__
asm("\n"
	".code 32\n"
	".global _start\n"
	".type _start, %function\n"
	"_start:\n"
	"\tadr r0, _start_thumb+1\n"
	"\tbx r0\n"
	".size _start, .-_start\n");

__attribute__((naked, used))
static void _start_thumb(void)
#else
__attribute__((naked))
void _start(void)
#endif
{
	register int *sp asm("sp");
	_main(*sp, (char **)(sp + 1));
}

static int _main(int argc, char *argv[])
{
	environ = argv + argc + 1;
	exit(main(argc, argv, environ));
}




See more files for this project here

Gdb

GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it executes -- or what another program was doing at the moment it crashed.

Project homepage: http://sources.redhat.com/gdb/
Programming language(s): Assembly,C,C++,Expect
License: other

  Makefile.in
  _exit.c
  _kill.c
  aclocal.m4
  coff-iq80310.specs
  coff-pid.specs
  coff-rdimon.specs
  coff-rdpmon.specs
  coff-redboot.ld
  coff-redboot.specs
  configure
  configure.in
  crt0.S
  elf-iq80310.specs
  elf-linux.specs
  elf-pid.specs
  elf-rdimon.specs
  elf-rdpmon.specs
  elf-redboot.ld
  elf-redboot.specs
  libcfunc.c
  linux-crt0.c
  linux-syscall.h
  linux-syscalls0.S
  linux-syscalls1.c
  redboot-crt0.S
  redboot-syscalls.c
  swi.h
  syscall.h
  syscalls.c
  trap.S