9d40326830
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 |
||
---|---|---|
.. | ||
isc | ||
__dso_handle.h | ||
__dso_handle_so.c | ||
arpa_nameser.h | ||
arpa_nameser_compat.h | ||
bionic_atomic_arm.h | ||
bionic_atomic_gcc_builtin.h | ||
bionic_atomic_inline.h | ||
bionic_atomic_x86.h | ||
bionic_futex.h | ||
bionic_pthread.h | ||
bionic_time.h | ||
bionic_tls.h | ||
cpuacct.h | ||
ctype_private.h | ||
logd.h | ||
nsswitch.h | ||
rand48.h | ||
resolv_cache.h | ||
resolv_iface.h | ||
resolv_private.h | ||
resolv_static.h | ||
syscommon.h | ||
thread_private.h |