dl-support.c 807 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Support for dynamic linking code in static libc.
  3. * Copyright (C) 1996-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
  4. *
  5. * Partially based on GNU C Library (file: libc/elf/dl-support.c)
  6. *
  7. * Copyright (C) 2008 STMicroelectronics Ltd.
  8. * Author: Carmelo Amoroso <carmelo.amoroso@st.com>
  9. *
  10. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  11. *
  12. */
  13. #include <link.h>
  14. #include <elf.h>
  15. ElfW(Phdr) *_dl_phdr;
  16. size_t _dl_phnum;
  17. void internal_function _dl_aux_init (ElfW(auxv_t) *av);
  18. void internal_function _dl_aux_init (ElfW(auxv_t) *av)
  19. {
  20. /* Get the program headers base address from the aux vect */
  21. _dl_phdr = (ElfW(Phdr) *) av[AT_PHDR].a_un.a_val;
  22. /* Get the number of program headers from the aux vect */
  23. _dl_phnum = (size_t) av[AT_PHNUM].a_un.a_val;
  24. }