prt0.as 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* Startup code for programs linked with GNU libc.
  2. Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. .section ".text"
  17. .globl _start
  18. _start:
  19. /* Save the stack pointer, in case we're statically linked under Linux. */
  20. mr 9,1
  21. /* Set up an initial stack frame, and clear the LR. */
  22. clrrwi 1,1,4
  23. li 0,0
  24. stwu 1,-16(1)
  25. mtlr 0
  26. stw 0,0(1)
  27. bl PASCALMAIN
  28. .globl _haltproc
  29. .type _haltproc,@function
  30. _haltproc:
  31. li 0,1 /* exit call */
  32. lis 3,U_SYSTEM_EXITCODE@h
  33. stw 3,U_SYSTEM_EXITCODE@l(3)
  34. sc
  35. b _haltproc
  36. /* Define a symbol for the first piece of initialized data. */
  37. .section ".data"
  38. .globl __data_start
  39. __data_start:
  40. data_start:
  41. .globl ___fpc_brk_addr /* heap management */
  42. .type ___fpc_brk_addr,@object
  43. .size ___fpc_brk_addr,4
  44. ___fpc_brk_addr:
  45. .long 0
  46. /*
  47. $Log$
  48. Revision 1.9 2002-09-07 16:01:20 peter
  49. * old logs removed and tabs fixed
  50. Revision 1.8 2002/08/31 21:29:57 florian
  51. * several PC related fixes
  52. Revision 1.7 2002/08/31 16:13:12 florian
  53. * made _start global
  54. Revision 1.6 2002/08/31 14:02:23 florian
  55. * r3 renamed to 3
  56. Revision 1.5 2002/08/31 14:01:28 florian
  57. * _haltproc to prt0.as added (Linux/PPC)
  58. Revision 1.4 2002/08/31 13:11:11 florian
  59. * several fixes for Linux/PPC compilation
  60. Revision 1.3 2002/08/19 21:19:15 florian
  61. * small fixes
  62. Revision 1.2 2002/07/26 17:09:44 florian
  63. * log fixed
  64. Revision 1.1 2002/07/26 16:57:40 florian
  65. + initial version, plain copy from glibc/sysdeps/powerpc/elf/start.S
  66. */