Commit 84a1b11
[vm] Add base class for shared object writers.
This CL pulls out the refactorings used to support the new MachOWriter
in a followup CL to allow them to be reviewed separately.
Rename Elf -> ElfWriter. Also rename model classes used by ElfWriter
for concepts that exist both in ELF and Mach-O to ElfX. For example,
the old ELF-specific SymbolTable is renamed to ElfSymbolTable.
Adds SharedObjectWriter to serve as a base class for both ElfWriter
and the upcoming MachOWriter.
Adds a new AbstractWriteStream that serves as a common superclass
of both BaseWriteStream and SharedObjectWriter::WriteStream and
allows the creation of fully delegating WriteStreams that do not
maintain a local buffer.
Abstract the old Elf::SymbolData class into
SharedObjectWriter::SymbolData, which stores an enum value as the type
of the symbol instead of storing the ELF encoding of the type.
Rename the DwarfElfStream (which actually wasn't ELF specific, as
all the ELF-specific DWARF information is handled by ElfWriter) to
DwarfSharedObjectStream and put it in a separate header file.
Rename Image::compiled_to_elf() to Image::compiled_to_shared_object()
and add a separate Image::compiled_to_elf() that checks for the ELF
magic value at the DSO base. Also add Image::shared_object_start()
and Image::build_id_start() to return pointers to the DSO base and
the build ID note, respectively.
Refactor Image::build_id() and Image::build_id_length() to check
compiled_for_elf() prior to decoding the data pointed to by
build_id_start() as an ELF note section.
Create an AOTSnapshotType enum to specific the snapshot writer to use
in CreateAppAOTSnapshot instead of using an as_elf boolean.
TEST=refactorings, so existing tests on ci
Change-Id: Ia3ab37a4dff93b6e00390b123753be5a51fbdaaa
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-mac-release-arm64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421301
Reviewed-by: Ryan Macnak <[email protected]>
Commit-Queue: Tess Strickland <[email protected]>1 parent ed2f893 commit 84a1b11
File tree
13 files changed
+1026
-709
lines changed- runtime
- platform
- vm
13 files changed
+1026
-709
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6429 | 6429 | | |
6430 | 6430 | | |
6431 | 6431 | | |
| 6432 | + | |
| 6433 | + | |
| 6434 | + | |
| 6435 | + | |
| 6436 | + | |
6432 | 6437 | | |
6433 | 6438 | | |
6434 | 6439 | | |
6435 | 6440 | | |
6436 | | - | |
| 6441 | + | |
6437 | 6442 | | |
6438 | 6443 | | |
6439 | 6444 | | |
| |||
6455 | 6460 | | |
6456 | 6461 | | |
6457 | 6462 | | |
6458 | | - | |
6459 | | - | |
6460 | | - | |
6461 | | - | |
6462 | | - | |
6463 | | - | |
6464 | | - | |
6465 | | - | |
6466 | | - | |
6467 | | - | |
6468 | | - | |
6469 | | - | |
6470 | | - | |
6471 | | - | |
6472 | | - | |
6473 | | - | |
6474 | | - | |
6475 | | - | |
6476 | | - | |
6477 | | - | |
| 6463 | + | |
| 6464 | + | |
| 6465 | + | |
| 6466 | + | |
| 6467 | + | |
| 6468 | + | |
| 6469 | + | |
| 6470 | + | |
| 6471 | + | |
6478 | 6472 | | |
6479 | | - | |
6480 | | - | |
6481 | | - | |
6482 | | - | |
6483 | | - | |
| 6473 | + | |
| 6474 | + | |
| 6475 | + | |
6484 | 6476 | | |
6485 | | - | |
6486 | | - | |
6487 | | - | |
6488 | | - | |
6489 | | - | |
6490 | | - | |
6491 | | - | |
6492 | | - | |
6493 | | - | |
6494 | | - | |
6495 | | - | |
6496 | | - | |
6497 | | - | |
6498 | | - | |
6499 | | - | |
6500 | | - | |
6501 | | - | |
6502 | | - | |
| 6477 | + | |
6503 | 6478 | | |
6504 | | - | |
6505 | | - | |
| 6479 | + | |
| 6480 | + | |
6506 | 6481 | | |
6507 | 6482 | | |
6508 | 6483 | | |
6509 | 6484 | | |
6510 | 6485 | | |
6511 | 6486 | | |
6512 | | - | |
| 6487 | + | |
| 6488 | + | |
| 6489 | + | |
| 6490 | + | |
| 6491 | + | |
| 6492 | + | |
| 6493 | + | |
| 6494 | + | |
| 6495 | + | |
| 6496 | + | |
| 6497 | + | |
| 6498 | + | |
| 6499 | + | |
| 6500 | + | |
| 6501 | + | |
| 6502 | + | |
| 6503 | + | |
| 6504 | + | |
| 6505 | + | |
| 6506 | + | |
| 6507 | + | |
| 6508 | + | |
6513 | 6509 | | |
6514 | 6510 | | |
6515 | 6511 | | |
6516 | 6512 | | |
6517 | 6513 | | |
6518 | 6514 | | |
6519 | | - | |
| 6515 | + | |
6520 | 6516 | | |
6521 | 6517 | | |
6522 | 6518 | | |
| |||
6548 | 6544 | | |
6549 | 6545 | | |
6550 | 6546 | | |
6551 | | - | |
| 6547 | + | |
6552 | 6548 | | |
6553 | 6549 | | |
6554 | 6550 | | |
| |||
6582 | 6578 | | |
6583 | 6579 | | |
6584 | 6580 | | |
6585 | | - | |
6586 | | - | |
| 6581 | + | |
| 6582 | + | |
| 6583 | + | |
6587 | 6584 | | |
6588 | 6585 | | |
6589 | 6586 | | |
| |||
6609 | 6606 | | |
6610 | 6607 | | |
6611 | 6608 | | |
6612 | | - | |
| 6609 | + | |
6613 | 6610 | | |
6614 | 6611 | | |
6615 | 6612 | | |
| |||
6663 | 6660 | | |
6664 | 6661 | | |
6665 | 6662 | | |
6666 | | - | |
| 6663 | + | |
6667 | 6664 | | |
6668 | 6665 | | |
6669 | 6666 | | |
| |||
6688 | 6685 | | |
6689 | 6686 | | |
6690 | 6687 | | |
6691 | | - | |
| 6688 | + | |
6692 | 6689 | | |
6693 | 6690 | | |
6694 | 6691 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
330 | 422 | | |
331 | 423 | | |
332 | | - | |
| 424 | + | |
333 | 425 | | |
334 | 426 | | |
335 | 427 | | |
336 | | - | |
337 | 428 | | |
338 | 429 | | |
339 | 430 | | |
| 431 | + | |
340 | 432 | | |
341 | | - | |
| 433 | + | |
342 | 434 | | |
343 | 435 | | |
344 | 436 | | |
| |||
474 | 566 | | |
475 | 567 | | |
476 | 568 | | |
477 | | - | |
| 569 | + | |
478 | 570 | | |
479 | 571 | | |
480 | 572 | | |
481 | 573 | | |
482 | 574 | | |
483 | 575 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | 576 | | |
564 | 577 | | |
565 | 578 | | |
| |||
0 commit comments