2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
8 * NaCl Simple/secure ELF loader (NaCl SEL).
11 #include "native_client/src/trusted/service_runtime/nacl_config.h"
14 * This is code, but it is not code that is actually part of the
15 * program/library being linked. Marking it as read-only data
16 * instead ensures that nothing like linker code-rewriting will
17 * be applied to this code.
21 DEFINE_GLOBAL_HIDDEN_LOCATION(NaCl_trampoline_code):
23 * Write a value onto the stack which is used to calculate the
26 movl $0xdeadbeef, -8(%rsp)
27 DEFINE_GLOBAL_HIDDEN_LOCATION(NaCl_trampoline_tramp_addr):
28 mov $0xdeadbeefcafebabe, %rax
29 DEFINE_GLOBAL_HIDDEN_LOCATION(NaCl_trampoline_call_target):
31 * Fetch the address of NaClSyscallSeg (or other syscall
32 * routine) and jump to it. We store the address in a
33 * location outside the sandbox so as not to defeat ASLR by
34 * leaking address space layout to untrusted code.
38 DEFINE_GLOBAL_HIDDEN_LOCATION(NaCl_trampoline_code_end):