Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: sysdeps/x86_64/dl-machine.h

Issue 7282019: Adjust for new NaCl startup ABI (Closed) Base URL: http://git.chromium.org/native_client/nacl-glibc.git@master
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« make_sysd_rules.py ('K') | « sysdeps/nacl/start.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sysdeps/x86_64/dl-machine.h
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 18b0c3b70c882f24d0b8a43a99ad74dd857663f7..23398c3d24b5f20159d0a82af39a0ab37b6615b0 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -152,24 +152,19 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
its return value is the user program's entry point. */
#ifdef __native_client__
-#define ARGV_ENTRY_SIZE_STR "4"
-#define ARGC_SIZE_PLUS_ARGV_ENTRY_SIZE_STR "12"
-#define ADJUST_SP \
- "leaq (%rsp,%rax,"ARGV_ENTRY_SIZE_STR"), %r13\n" \
- "naclrestsp %r13d, %r15"
-#define CLEAR_BP "naclrestbp $0, %r15"
-#define MOV_R13_SP "naclrestsp %r13d, %r15"
-#define JMP_R12 "nacljmp %r12d, %r15"
+
+/* We're started with the normal C ABI for a one-argument function.
+ Our version of _dl_start runs the user's entry point directly, rather
+ than returning it. Since the NaCl trusted runtime starts us up with
+ the registers set up for a normal C function call of one argument,
+ we can just go directly into _dl_start with no adjustment. */
+
+#define RTLD_START asm("\n\
+.globl _start\n\
+.set _start, _dl_start\n\
+");
#else
-#define ARGV_ENTRY_SIZE_STR "8"
-#define ARGC_SIZE_PLUS_ARGV_ENTRY_SIZE_STR "16"
-#define ADJUST_SP \
- "leaq (%rsp,%rax,"ARGV_ENTRY_SIZE_STR"), %rsp"
-#define CLEAR_BP "xorl %ebp, %ebp"
-#define MOV_R13_SP "movq %r13, %rsp"
-#define JMP_R12 "jmp *%r12"
-#endif
#define RTLD_START asm ("\n\
.text\n\
@@ -219,6 +214,8 @@ _dl_start_user:\n\
.previous\n\
");
+#endif
+
/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
TLS variable, so undefined references should not be allowed to
define the value.
« make_sysd_rules.py ('K') | « sysdeps/nacl/start.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698