summaryrefslogtreecommitdiffstats
path: root/linker/arch/x86
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-02-07 10:14:39 -0800
committerElliott Hughes <enh@google.com>2013-02-07 11:44:21 -0800
commit42b2c6a5eed5e4ef35315b8cd32d1355f12a69b6 (patch)
tree0fb55a369b620ef79cfa103f67a5184f067dadeb /linker/arch/x86
parentd32fdbaf03f688497adbec885e85c0a69f7a4542 (diff)
downloadbionic-42b2c6a5eed5e4ef35315b8cd32d1355f12a69b6.zip
bionic-42b2c6a5eed5e4ef35315b8cd32d1355f12a69b6.tar.gz
bionic-42b2c6a5eed5e4ef35315b8cd32d1355f12a69b6.tar.bz2
Clean up the argc/argv/envp/auxv handling.
There's now only one place where we deal with this stuff, it only needs to be parsed once by the dynamic linker (rather than by each recipient), and it's now easier for us to get hold of auxv data early on. Change-Id: I6314224257c736547aac2e2a650e66f2ea53bef5
Diffstat (limited to 'linker/arch/x86')
-rwxr-xr-xlinker/arch/x86/begin.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/linker/arch/x86/begin.c b/linker/arch/x86/begin.c
index 4f3e0ab..cdc98e0 100755
--- a/linker/arch/x86/begin.c
+++ b/linker/arch/x86/begin.c
@@ -26,24 +26,23 @@
* SUCH DAMAGE.
*/
-#include <stdint.h>
+#include <sys/cdefs.h>
-extern unsigned __linker_init(unsigned int *elfdata);
+extern unsigned __linker_init(void* raw_args);
-__attribute__((visibility("hidden")))
-void _start() {
+__LIBC_HIDDEN__ void _start() {
void (*start)(void);
- void* elfdata = (void*) ((uintptr_t) __builtin_frame_address(0) + sizeof(void*));
- start = (void(*)(void))__linker_init(elfdata);
+ void* raw_args = (void*) ((uintptr_t) __builtin_frame_address(0) + sizeof(void*));
+ start = (void(*)(void))__linker_init(raw_args);
/* linker init returns (%eax) the _entry address in the main image */
- /* entry point expects sp to point to elfdata */
+ /* entry point expects sp to point to raw_args */
__asm__ (
"mov %0, %%esp\n\t"
"jmp *%1\n\t"
- : : "r"(elfdata), "r"(start) :
+ : : "r"(raw_args), "r"(start) :
);
/* Unreachable */