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

Unified Diff: tests/pnacl_dynamic_loading/test_pso.c

Issue 352213002: PNaCl dynamic loading: Extend pnacl-translate to be able to translate PSOs (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Cleanup Created 6 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
« no previous file with comments | « tests/pnacl_dynamic_loading/nacl.scons ('k') | toolchain_build/toolchain_build_pnacl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/pnacl_dynamic_loading/test_pso.c
diff --git a/tests/pnacl_dynamic_loading/test_pso.c b/tests/pnacl_dynamic_loading/test_pso.c
new file mode 100644
index 0000000000000000000000000000000000000000..ad4d5c1e5749f53a30e55dd6884ea3b27933e1c8
--- /dev/null
+++ b/tests/pnacl_dynamic_loading/test_pso.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2014 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+static int var = 2345;
+
+static int example_func(int *ptr) {
+ return *ptr + 1234;
+}
+
+static int *get_var(void) {
+ /* Test use of -fPIC by getting an address. */
+ return &var;
+}
+
+struct pso_root {
+ int (*example_func)(int *ptr);
+ int *(*get_var)(void);
+};
+
+struct pso_root __pnacl_pso_root = {
+ example_func,
+ get_var,
+};
« no previous file with comments | « tests/pnacl_dynamic_loading/nacl.scons ('k') | toolchain_build/toolchain_build_pnacl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698