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

Side by Side Diff: src/untrusted/nacl/pthread_initialize_minimal_using_ldso.c

Issue 22859030: Remove wrapper-link-and-translate from PNaCl and pnacl_shared_newlib from SCons. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: one more reference Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/untrusted/nacl/nacl.scons ('k') | src/untrusted/nacl/tls_using_ldso.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
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.
5 */
6
7 #include <unistd.h>
8
9 #include "native_client/src/untrusted/nacl/nacl_irt.h"
10 #include "native_client/src/untrusted/nacl/nacl_thread.h"
11 #include "native_client/src/untrusted/nacl/tls.h"
12 #include "native_client/src/untrusted/nacl/tls_params.h"
13
14 /*
15 * This initialization happens early in startup with or without libpthread.
16 * It must make it safe for vanilla newlib code to run.
17 */
18 void __pthread_initialize_minimal(size_t tdb_size) {
19 /*
20 * ld.so does most of the work for us, e.g.
21 * allocating and initialzing the tls area.
22 * For x86 we still need put the tdb in a
23 * state which our libpthread expects.
24 * This relies heavily on our tdb being "compatible" with
25 * glibc's tdb.
26 * C.f src/untrusted/pthread/pthread_types.h
27 */
28
29 /*
30 * the extra initialization is only needed for x86
31 */
32 if (__nacl_tp_tdb_offset(tdb_size) == 0) {
33 char *tp = __nacl_read_tp();
34 void *tdb = (char *) tp + __nacl_tp_tdb_offset(tdb_size);
35 *(void **) tdb = tdb;
36 }
37
38 /*
39 * Initialize newlib's thread-specific pointer.
40 */
41 __newlib_thread_init();
42 }
OLDNEW
« no previous file with comments | « src/untrusted/nacl/nacl.scons ('k') | src/untrusted/nacl/tls_using_ldso.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698