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

Issue 4181005: Fixes some bugs with memory setup and halt-sled allocation and... (Closed)

Created:
10 years, 1 month ago by bsy
Modified:
9 years, 7 months ago
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Fixes some bugs with memory setup and halt-sled allocation and initialization. Tests in assembly language are written to be text-only -- no rodata nor data segments are present in one set of tests -- with varying sizes of padding so that the text segment ends exactly at a multiple of 65536, just 32 bytes shy of it (the halt sled size), many bytes shy of a multiple, and 28 bytes shy of 65536 (too small gap). The text prints out the break address and the end-of-text address to check the rounding that's done by the sel_ldr. In addition to the 4 text-only tests, this CL also builds a set with rodata -- containing a string -- at its "natural" position, and another set with rodata at 0x100000, leaving space for dynamic code. These additional eight tests have _ro and _ro_dyn in their names. In order to get exact memory layout, the tests are built by directly invoking the loader, rather than indirectly through nacl-g++. For the x86-* architectures, we are using nacl-ld; for the arm, we are using code sourcery's ld and patching the generated exectuable with the elf_patcher.py script to modify the Elf headers to be nexes as opposed to standard executables. Because there appears to be a linker bug on the ARM, the _ro_dyn tests are not built -- the text is moved to an address other than 0x20000, despite command-line flags to the contrary. One ARM test (too_small_ro) triggers a LOG_FATAL because the ARM linker will not automatically move the .rodata section to ensure that there is enough room for the halt sled. If we could use linker scripts so that full control is feasible but defaulting to automatically always reserving gap space, that would be ideal behavior.... The next set of CLs will add tests where data segments *are* present as well, and where no rodata is present but rw data is present -- more test case combinatorics. And the address space setup code needs to be cleaned up still. BUG= http://code.google.com/p/nativeclient/issues/detail?id=506 http://code.google.com/p/nativeclient/issues/detail?id=877 TEST= run_nacl_text_no_pad_test run_nacl_text_small_pad_test run_nacl_text_large_pad_test run_nacl_text_too_small_pad_test run_nacl_text_no_pad_ro_test run_nacl_text_small_pad_ro_test run_nacl_text_large_pad_ro_test run_nacl_text_too_small_pad_ro_test run_nacl_text_no_pad_ro_dyn_test run_nacl_text_small_pad_ro_dyn_test run_nacl_text_large_pad_ro_dyn_test run_nacl_text_too_small_pad_ro_dyn_test Committed: http://src.chromium.org/viewvc/native_client?view=rev&revision=3635

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Total comments: 25

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1113 lines, -37 lines) Patch
M SConstruct View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -1 line 0 comments Download
M site_scons/site_tools/naclsdk.py View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -0 lines 0 comments Download
A src/trusted/service_runtime/arch/arm/nacl_text_pad_test.S View 4 5 6 7 8 9 10 1 chunk +226 lines, -0 lines 0 comments Download
A src/trusted/service_runtime/arch/x86_32/nacl_text_pad_test.S View 1 2 3 4 5 6 7 8 1 chunk +211 lines, -0 lines 0 comments Download
A src/trusted/service_runtime/arch/x86_64/nacl_text_pad_test.S View 1 2 3 4 5 6 7 8 1 chunk +188 lines, -0 lines 0 comments Download
A src/trusted/service_runtime/nacl.scons View 2 3 4 5 6 7 8 9 10 11 1 chunk +178 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/nacl_error_code.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/nacl_text.c View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M src/trusted/service_runtime/sel_ldr.c View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +8 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/sel_ldr_standard.c View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +134 lines, -27 lines 0 comments Download
M tools/command_tester.py View 4 5 6 7 8 9 10 11 12 1 chunk +7 lines, -0 lines 0 comments Download
M tools/elf.py View 3 4 5 6 7 8 9 10 11 12 2 chunks +8 lines, -0 lines 0 comments Download
A tools/elf_patcher.py View 4 5 6 7 8 9 10 1 chunk +84 lines, -0 lines 0 comments Download
A tools/nacl_elf_constants.py View 1 chunk +32 lines, -0 lines 0 comments Download
M tools/set_abi_version.py View 3 4 5 6 7 8 9 10 11 12 6 chunks +26 lines, -8 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
bsy
10 years, 1 month ago (2010-11-03 00:33:21 UTC) #1
bsy
PTAL
10 years, 1 month ago (2010-11-04 23:55:07 UTC) #2
Cliff L. Biffle
LGTM - no objections to you landing this. I have a few thoughts on further ...
10 years, 1 month ago (2010-11-05 20:32:02 UTC) #3
bsy
PTAL http://codereview.chromium.org/4181005/diff/48001/49003 File src/trusted/service_runtime/arch/arm/nacl_text_pad_test.S (right): http://codereview.chromium.org/4181005/diff/48001/49003#newcode11 src/trusted/service_runtime/arch/arm/nacl_text_pad_test.S:11: * This is a translation from the x86-{32,64} ...
10 years, 1 month ago (2010-11-06 23:47:01 UTC) #4
sehr (please use chromium)
One egregious agreement. Otherwise, LGTM. http://codereview.chromium.org/4181005/diff/48001/49006 File src/trusted/service_runtime/nacl.scons (right): http://codereview.chromium.org/4181005/diff/48001/49006#newcode178 src/trusted/service_runtime/nacl.scons:178: env.AddNodeToTestSuite(node, ['small_tests'], 'run_' + ...
10 years, 1 month ago (2010-11-08 17:01:23 UTC) #5
bsy
thx. http://codereview.chromium.org/4181005/diff/48001/49006 File src/trusted/service_runtime/nacl.scons (right): http://codereview.chromium.org/4181005/diff/48001/49006#newcode1 src/trusted/service_runtime/nacl.scons:1: # -*- python -*- On 2010/11/05 20:32:02, Cliff ...
10 years, 1 month ago (2010-11-08 18:48:25 UTC) #6
Mark Seaborn
On 2010/11/08 18:48:25, bsy wrote: > http://codereview.chromium.org/4181005/diff/48001/49006 > File src/trusted/service_runtime/nacl.scons (right): > > http://codereview.chromium.org/4181005/diff/48001/49006#newcode1 > ...
10 years, 1 month ago (2010-11-08 19:49:25 UTC) #7
bsy
10 years, 1 month ago (2010-11-09 02:53:06 UTC) #8
r3635

Powered by Google App Engine
This is Rietveld 408576698