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

Unified Diff: tests/stubout_mode/partly_invalid.c

Issue 12256018: [MIPS] Add remaining parts for building tests for MIPS (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Minor cleanup. Created 7 years, 9 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/stubout_mode/nacl.scons ('k') | tests/toolchain/eh_return.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/stubout_mode/partly_invalid.c
diff --git a/tests/stubout_mode/partly_invalid.c b/tests/stubout_mode/partly_invalid.c
index 38fa15f60bc5e8c5de36e61270ec530346759d6a..2743a8a417f34ccdaaee0afa6f4eda875dbae198 100644
--- a/tests/stubout_mode/partly_invalid.c
+++ b/tests/stubout_mode/partly_invalid.c
@@ -1,7 +1,7 @@
/*
- * Copyright 2010 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.
+ * Copyright (c) 2010 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.
*/
#include <stdio.h>
@@ -10,6 +10,14 @@ void unfixed_code(void);
#if defined(__i386__) || defined(__x86_64__)
__asm__("unfixed_code: ret\n");
+#elif defined(__mips__)
+/*
+ * We need to mark unfixed_code as global, otherwise linker can not resolve pic
+ * CALL16 relocation against local symbol unfixed_code.
+ */
+__asm__(".global unfixed_code\n"
+ "unfixed_code: jr $ra\n"
+ "nop\n");
#else
# error "Unsupported architecture"
#endif
@@ -31,6 +39,11 @@ __asm__(".p2align 5\n"
/* "0f 05" disassembles to "syscall". */
".fill 1000, 2, 0x050f\n"
".p2align 5\n");
+#elif defined(__mips__)
+__asm__(".p2align 4\n"
+ /* "0xc" disassembles to "syscall". */
+ ".fill 1000, 4, 0x0000000c\n"
+ ".p2align 4\n");
#else
# error "Unsupported architecture"
#endif
« no previous file with comments | « tests/stubout_mode/nacl.scons ('k') | tests/toolchain/eh_return.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698