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

Side by Side Diff: src/trusted/service_runtime/linux/nacl_bootstrap.c

Issue 2164993002: Update linux-syscall-support to 3f6478ac95edf86cd3da300c2c0d34a438f5dbeb (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Remove bogus slash Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « buildbot/buildbot_standard.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 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 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 * 5 *
6 * This is a standalone program that loads and runs the dynamic linker. 6 * This is a standalone program that loads and runs the dynamic linker.
7 * This program itself must be linked statically. To keep it small, it's 7 * This program itself must be linked statically. To keep it small, it's
8 * written to avoid all dependencies on libc and standard startup code. 8 * written to avoid all dependencies on libc and standard startup code.
9 * Hence, this should be linked using -nostartfiles. It must be compiled 9 * Hence, this should be linked using -nostartfiles. It must be compiled
10 * with -fno-stack-protector to ensure the compiler won't emit code that 10 * with -fno-stack-protector to ensure the compiler won't emit code that
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 int fd, void *buf, size_t bufsz, uintptr_t pos) { 171 int fd, void *buf, size_t bufsz, uintptr_t pos) {
172 ssize_t result = sys_pread64(fd, buf, bufsz, pos); 172 ssize_t result = sys_pread64(fd, buf, bufsz, pos);
173 if (result < 0) 173 if (result < 0)
174 fail(file, fail_message, "errno", my_errno, NULL, 0); 174 fail(file, fail_message, "errno", my_errno, NULL, 0);
175 if ((size_t) result != bufsz) 175 if ((size_t) result != bufsz)
176 fail(file, fail_message, "read count", result, NULL, 0); 176 fail(file, fail_message, "read count", result, NULL, 0);
177 } 177 }
178 178
179 static uintptr_t my_mmap_simple(uintptr_t address, size_t size, 179 static uintptr_t my_mmap_simple(uintptr_t address, size_t size,
180 int prot, int flags, int fd, uintptr_t pos) { 180 int prot, int flags, int fd, uintptr_t pos) {
181 #if defined(__NR_mmap2)
182 void *result = sys_mmap2((void *) address, size, prot, flags, fd, pos >> 12);
183 #else
184 void *result = sys_mmap((void *) address, size, prot, flags, fd, pos); 181 void *result = sys_mmap((void *) address, size, prot, flags, fd, pos);
185 #endif
186 return (uintptr_t) result; 182 return (uintptr_t) result;
187 } 183 }
188 184
189 static uintptr_t my_mmap(const char *file, 185 static uintptr_t my_mmap(const char *file,
190 const char *segment_type, unsigned int segnum, 186 const char *segment_type, unsigned int segnum,
191 uintptr_t address, size_t size, 187 uintptr_t address, size_t size,
192 int prot, int flags, int fd, uintptr_t pos) { 188 int prot, int flags, int fd, uintptr_t pos) {
193 uintptr_t result = my_mmap_simple(address, size, prot, flags, fd, pos); 189 uintptr_t result = my_mmap_simple(address, size, prot, flags, fd, pos);
194 if ((void *) result == MAP_FAILED) 190 if ((void *) result == MAP_FAILED)
195 fail(file, "Failed to map segment! ", 191 fail(file, "Failed to map segment! ",
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 717
722 #if defined(__arm__) 718 #if defined(__arm__)
723 /* 719 /*
724 * We may bring in __aeabi_* functions from libgcc that in turn 720 * We may bring in __aeabi_* functions from libgcc that in turn
725 * want to call raise. 721 * want to call raise.
726 */ 722 */
727 int raise(int sig) { 723 int raise(int sig) {
728 return sys_kill(sys_getpid(), sig); 724 return sys_kill(sys_getpid(), sig);
729 } 725 }
730 #endif 726 #endif
OLDNEW
« no previous file with comments | « buildbot/buildbot_standard.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698