bionic/libc/arch-x86/bionic
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
..
__dso_handle_so.S arm: rewrite crtbegin* as C files. 2012-06-01 14:41:27 -07:00
__dso_handle.S arm: rewrite crtbegin* as C files. 2012-06-01 14:41:27 -07:00
__get_sp.S auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
__get_tls.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
__set_tls.c bionic/x86: fix one potential deadlock in __set_tls() 2012-02-23 17:37:58 +08:00
__stack_chk_fail_local.S x86: Enable -fstack-protector 2011-05-24 13:32:14 -07:00
_exit_with_stack_teardown.S auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
_setjmp.S auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
atexit.S Enable functional DSO object destruction 2011-06-20 14:44:44 -07:00
clone.S libc/x86: ensure the stack 16-byte aligned when tasks created 2012-03-23 20:04:04 +08:00
crtbegin_so.S Enable functional DSO object destruction 2011-06-20 14:44:44 -07:00
crtbegin.S crtbegin: eliminate duplicate code 2012-05-30 11:45:12 -07:00
crtend_so.S Update X86 Bionic CRT files for unwind/exceptions 2011-05-24 13:31:50 -07:00
crtend.S Update X86 Bionic CRT files for unwind/exceptions 2011-05-24 13:31:50 -07:00
dl_iterate_phdr_static.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
futex_x86.S libc: provide atomic operations will full barriers for NDK apps. 2011-11-16 17:37:15 +01:00
setjmp.S auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
sigsetjmp.S android-x86: add sigsetjmp.S 2010-12-26 09:22:13 -08:00
syscall.S x86 libc: Fix the range to check the error 2011-06-17 14:37:50 -07:00
vfork.S auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00