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

Side by Side Diff: third_party/android_crazy_linker/src/tests/bar_with_relro.cpp

Issue 328153002: Roll to android/platform/ndk/681f1b744aec1b0888f4c7a68165720db9670300 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fork
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <android/log.h> 5 #include <android/log.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 // A variant of bar.cpp that also includes a large RELRO section. 9 // A variant of bar.cpp that also includes a large RELRO section.
10 // Used to test RELRO sharing with two different libraries at the 10 // Used to test RELRO sharing with two different libraries at the
(...skipping 12 matching lines...) Expand all
23 extern "C" void Foo(); 23 extern "C" void Foo();
24 24
25 extern "C" void Bar() { 25 extern "C" void Bar() {
26 printf("%s: Entering\n", __FUNCTION__); 26 printf("%s: Entering\n", __FUNCTION__);
27 __android_log_print(ANDROID_LOG_INFO, "bar", "Hi There!"); 27 __android_log_print(ANDROID_LOG_INFO, "bar", "Hi There!");
28 fprintf(stderr, "Hi There! from Bar\n"); 28 fprintf(stderr, "Hi There! from Bar\n");
29 29
30 for (size_t n = 0; n < sizeof(kStrings) / sizeof(kStrings[0]); ++n) { 30 for (size_t n = 0; n < sizeof(kStrings) / sizeof(kStrings[0]); ++n) {
31 const char* ptr = kStrings[n]; 31 const char* ptr = kStrings[n];
32 if (strcmp(ptr, "another example string")) { 32 if (strcmp(ptr, "another example string")) {
33 printf("%s: Bad string at offset=%d\n", __FUNCTION__, n); 33 printf("%s: Bad string at offset=%zu\n", __FUNCTION__, n);
Anton 2014/06/11 15:31:54 Style guide says %"PRIuS" :-(
34 exit(1); 34 exit(1);
35 } 35 }
36 } 36 }
37 37
38 printf("%s: Calling Foo()\n", __FUNCTION__); 38 printf("%s: Calling Foo()\n", __FUNCTION__);
39 Foo(); 39 Foo();
40 40
41 printf("%s: Exiting\n", __FUNCTION__); 41 printf("%s: Exiting\n", __FUNCTION__);
42 } 42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698