dl-support.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Support for dynamic linking code in static libc.
  2. Copyright (C) 1996-2002, 2003, 2004, 2005 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. /* This file defines some things that for the dynamic linker are defined in
  17. rtld.c and dl-sysdep.c in ways appropriate to bootstrap dynamic linking. */
  18. #include <link.h>
  19. #include <elf.h>
  20. ElfW(Phdr) *_dl_phdr;
  21. size_t _dl_phnum;
  22. void
  23. internal_function
  24. _dl_aux_init (ElfW(auxv_t) *av)
  25. {
  26. /* Get the program headers base address from the aux vect */
  27. _dl_phdr = (ElfW(Phdr) *) av[AT_PHDR].a_un.a_val;
  28. /* Get the number of program headers from the aux vect */
  29. _dl_phnum = (size_t) av[AT_PHNUM].a_un.a_val;
  30. }