History log of /bionic/libc/arch-arm/bionic/crtbegin_so.c
Revision Date Author Comments
048569be54188fadde19d5e48363e5fe3943023a 05-Sep-2012 Andrew Hsieh <andrewhsieh@google.com> Rename __dso_handle_so.c to __dso_handle_so.h

Also chang libc/arch-arm/bionic/crtbegin_so.c to include it
as a header.

Change-Id: Ib91b0b8caf5c8b936425aa8a4fc1a229b2b27929
f3cfcd869ded41d25c1f4f4e48e7c374a64f9583 21-Aug-2012 Ard Biesheuvel <ard.biesheuvel@gmail.com> ARM: make CRT_LEGACY_WORKAROUND work as intended

To properly support legacy ARM shared libraries, libc.so needs
to export the symbols __dso_handle and atexit, even though
these are now supplied by the crt startup code.

This patch reshuffles the existing CRT_LEGACY_WORKAROUND
conditionally compiled code slightly so it works as the
original author likely intended.

Change-Id: Id6c0e94dc65b7928324a5f0bad7eba6eb2f464b9
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
5ed48a4d7fece002afbbd2bd981563aea6e52e24 21-Aug-2012 Ard Biesheuvel <ard.biesheuvel@gmail.com> ARM: make sure __on_dlclose() actually gets called

Change-Id: I280e5428b0543cccf17ca36baee4865395928cdb
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
9d40326830c2bd407427889c554adeb915ee6b4a 31-May-2012 Nick Kralevich <nnk@google.com> 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