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

Issue 8161004: Handle ELFCLASS32 files for x86-64 (Closed)

Created:
9 years, 2 months ago by Roland McGrath
Modified:
9 years, 2 months ago
Reviewers:
bsy, Mark Seaborn, Karl
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Handle ELFCLASS32 files for x86-64 In the future we will use an x86-64 toolchain based on the "x32" ABI. This uses ELFCLASS32 files for x86-64. Prepare for this by supporting such files now. We do this by making the internal representation of ELF files use ELFCLASS32 format unconditionally. On reading ELFCLASS64 files, we convert the header formats to the 32-bit representations. Since we do not yet have x32-based tools for NaCl, the only way to test an ELFCLASS32 x86-64 file is construct one by hand using the latest Linux assembler and linker in x32 mode. I've done this for a trivial all-assembly "Hello world" program. We test that ncval accepts this program and that sel_ldr executes it correctly. BUG= http://code.google.com/p/nativeclient/issues/detail?id=349 TEST= trybots R=bsy@google.com,kschimpf@google.com Committed: http://src.chromium.org/viewvc/native_client?view=rev&revision=6911

Patch Set 1 #

Patch Set 2 : add some casts to silence windows compiler #

Patch Set 3 : error message changes for some death tests with high bits set in header fields #

Patch Set 4 : more explicit casts #

Patch Set 5 : expected error msgs change only for x86-64 #

Patch Set 6 : rebased; binary testdata committed separately #

Total comments: 2

Patch Set 7 : add comment; fix integer overflow case #

Total comments: 14

Patch Set 8 : comment and style changes per review #

Total comments: 3

Patch Set 9 : e_phentsize checks with != #

Total comments: 3

Patch Set 10 : error code renamed #

Patch Set 11 : add new NaClErrorCode values at the end, do not reuse unused old numbers #

Patch Set 12 : typo fixes in last iteration #

Unified diffs Side-by-side diffs Delta from patch set Stats (+403 lines, -189 lines) Patch
M src/include/elf.h View 1 2 3 4 5 6 7 5 chunks +37 lines, -103 lines 0 comments Download
M src/tools/validator_tools/ncstubout.c View 2 chunks +41 lines, -5 lines 0 comments Download
M src/trusted/service_runtime/build.scons View 1 2 3 4 5 6 7 8 1 chunk +10 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/elf_util.c View 1 2 3 4 5 6 7 8 9 8 chunks +151 lines, -51 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 3 chunks +9 lines, -3 lines 0 comments Download
M src/trusted/service_runtime/nacl_error_code.c View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +8 lines, -2 lines 0 comments Download
A src/trusted/service_runtime/testdata/x86_64/integer_overflow_while_madvising.stderr View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A src/trusted/service_runtime/testdata/x86_64/text_too_big.stderr View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M src/trusted/validator/ncfileutil.c View 1 2 3 5 chunks +136 lines, -25 lines 0 comments Download
M src/trusted/validator_x86/build.scons View 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Roland McGrath
9 years, 2 months ago (2011-10-05 21:20:38 UTC) #1
Mark Seaborn
You can set BUG=http://code.google.com/p/nativeclient/issues/detail?id=349
9 years, 2 months ago (2011-10-05 22:02:49 UTC) #2
bsy
one integer overflow bug. one comment nit. i'd like to take a little more time ...
9 years, 2 months ago (2011-10-11 00:26:52 UTC) #3
Roland McGrath
Fixed.
9 years, 2 months ago (2011-10-11 16:57:03 UTC) #4
bsy
more issues. one is an integer overflow. http://codereview.chromium.org/8161004/diff/18001/src/include/elf.h File src/include/elf.h (right): http://codereview.chromium.org/8161004/diff/18001/src/include/elf.h#newcode18 src/include/elf.h:18: * formats ...
9 years, 2 months ago (2011-10-11 21:21:19 UTC) #5
Roland McGrath
On 2011/10/11 21:21:19, bsy wrote: > http://codereview.chromium.org/8161004/diff/18001/src/include/elf.h#newcode18 > src/include/elf.h:18: * formats internally. For compatibility with ...
9 years, 2 months ago (2011-10-11 23:26:16 UTC) #6
bsy
plz in the future reply via reply button on code review tool, since that makes ...
9 years, 2 months ago (2011-10-11 23:59:38 UTC) #7
bsy
http://codereview.chromium.org/8161004/diff/24001/src/trusted/service_runtime/elf_util.c File src/trusted/service_runtime/elf_util.c (right): http://codereview.chromium.org/8161004/diff/24001/src/trusted/service_runtime/elf_util.c#newcode459 src/trusted/service_runtime/elf_util.c:459: if (ehdr.ehdr64.e_phentsize < sizeof(Elf64_Phdr)) { s/</!=/ http://codereview.chromium.org/8161004/diff/24001/src/trusted/service_runtime/elf_util.c#newcode511 src/trusted/service_runtime/elf_util.c:511: if ...
9 years, 2 months ago (2011-10-12 00:01:50 UTC) #8
Roland McGrath
On 2011/10/11 23:59:38, bsy wrote: > plz in the future reply via reply button on ...
9 years, 2 months ago (2011-10-12 20:03:00 UTC) #9
bsy
http://codereview.chromium.org/8161004/diff/24001/src/trusted/service_runtime/elf_util.c File src/trusted/service_runtime/elf_util.c (right): http://codereview.chromium.org/8161004/diff/24001/src/trusted/service_runtime/elf_util.c#newcode459 src/trusted/service_runtime/elf_util.c:459: if (ehdr.ehdr64.e_phentsize < sizeof(Elf64_Phdr)) { On 2011/10/12 00:01:50, bsy ...
9 years, 2 months ago (2011-10-12 20:12:37 UTC) #10
Roland McGrath
On 2011/10/12 20:12:37, bsy wrote: > i meant clicking on the comment text and then ...
9 years, 2 months ago (2011-10-12 20:25:48 UTC) #11
bsy
9 years, 2 months ago (2011-10-12 20:37:09 UTC) #12
lgtm.  thx 4 putting up w/ my nits.

Powered by Google App Engine
This is Rietveld 408576698