platform_bionic/libc/private
Nick Kralevich 9d40326830 arm: rewrite crtbegin* as C files.
Rewrite
 crtbegin.S     -> crtbegin.c
 crtbegin_so.S  -> crtbegin_so.c

This change allows us to generate PIC code without relying
on text relocations.

As a consequence of this rewrite, also rewrite
  __dso_handle.S    -> __dso_handle.c
  __dso_handle_so.S -> __dso_handle_so.c
  atexit.S          -> atexit.c

In crtbegin.c _start, place the __PREINIT_ARRAY__, __INIT_ARRAY__,
__FINI_ARRAY__, and __CTOR_LIST__ variables onto the stack, instead of
passing a pointer to the text section of the binary.

This change appears sorta wonky, as I attempted to preserve,
as much as possible, the structure of the original assembly.
As a result, you have C files including other C files, and other
programming uglyness.

Result: This change reduces the number of files with text-relocations
from 315 to 19 on my Android build.

Before:
  $ scanelf -aR $OUT/system | grep TEXTREL | wc -l
  315

After:
  $ scanelf -aR $OUT/system | grep TEXTREL | wc -l
  19

Change-Id: Ib9f98107c0eeabcb606e1ddc7ed7fc4eba01c9c4
2012-06-01 14:41:27 -07:00
..
isc auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
__dso_handle.h arm: rewrite crtbegin* as C files. 2012-06-01 14:41:27 -07:00
__dso_handle_so.c arm: rewrite crtbegin* as C files. 2012-06-01 14:41:27 -07:00
arpa_nameser.h Fix spurious DNS lookups in the C library. 2010-03-08 15:22:13 -08:00
arpa_nameser_compat.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
bionic_atomic_arm.h bionic: Do not use <sys/atomics.h> for platform code. 2011-11-16 16:28:10 +01:00
bionic_atomic_gcc_builtin.h bionic: Do not use <sys/atomics.h> for platform code. 2011-11-16 16:28:10 +01:00
bionic_atomic_inline.h bionic: Do not use <sys/atomics.h> for platform code. 2011-11-16 16:28:10 +01:00
bionic_atomic_x86.h bionic: Do not use <sys/atomics.h> for platform code. 2011-11-16 16:28:10 +01:00
bionic_futex.h Use private futexes for semaphores, unless they are initialized with pshared != 0. 2010-06-08 17:04:49 -07:00
bionic_pthread.h Handle pthread-related changes (mutex/atfork) 2012-03-26 15:38:59 -07:00
bionic_time.h libc: Copy private C library declarations to private/ 2012-01-13 13:26:50 +01:00
bionic_tls.h Initialize TLS before any application code is run. 2012-04-13 00:08:11 +04:00
cpuacct.h Remove compiler warnings when building Bionic. 2010-06-22 17:51:41 -07:00
ctype_private.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
logd.h Revert "Revert "libc: Add logcat error message for memory corruption"" 2011-07-06 12:58:56 -07:00
nsswitch.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
rand48.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
resolv_cache.h Add support for a dns cache per interface 2011-06-08 15:39:29 +02:00
resolv_iface.h libc: Copy private C library declarations to private/ 2012-01-13 13:26:50 +01:00
resolv_private.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
resolv_static.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
syscommon.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
thread_private.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00