Chromium Code Reviews| Index: chrome/nacl/nacl_helper_bootstrap_linux.c |
| diff --git a/chrome/nacl/nacl_helper_bootstrap_linux.c b/chrome/nacl/nacl_helper_bootstrap_linux.c |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f178430b88bdd543a5c3ef1c4a98ff73c27f0570 |
| --- /dev/null |
| +++ b/chrome/nacl/nacl_helper_bootstrap_linux.c |
| @@ -0,0 +1,24 @@ |
| +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + * |
| + * Bootstraping the nacl_helper. This executable reserves the bottom 1G |
| + * of the address space, then invokes nacl_helper_main. Note that, |
|
agl
2011/08/16 16:44:39
|nacl_helper_main| doesn't match up with the funct
Brad Chen
2011/08/16 18:05:16
Done.
|
| + * as the text of this executable will eventually be overwritten by the |
| + * native_client module, nacl_helper_init must not attempt to return. |
| + */ |
| + |
| +#include <stdlib.h> |
| + |
| +/* reserve 1GB of space */ |
| +#define ONEGIG (1 << 30) |
| +char nacl_reserved_space[ONEGIG]; |
|
agl
2011/08/16 16:44:39
You pass in linker arguments to make the text segm
Brad Chen
2011/08/16 18:05:16
The kernel is quite inflexible about order of sect
|
| + |
| +void nacl_helper_init(int argc, char *argv[], |
| + const char *nacl_reserved_space); |
| + |
| +int main(int argc, char *argv[]) { |
| + nacl_helper_init(argc, argv, nacl_reserved_space); |
| + abort(); |
| + return 0; // convince the tools I'm sane. |
| +} |