Changeset 58806 in vbox
- Timestamp:
- Nov 20, 2015 8:02:34 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 104260
- Location:
- trunk/src/VBox/ValidationKit/bootsectors/bs3kit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
r58799 r58806 177 177 define TOOL_Bs3Ow32_COMPILE_C_CMDS 178 178 $(TOOL_OPENWATCOM_COMPILE_C_CMDS) 179 # $(QUIET)$(VBoxBs3ObjConverter_1_TARGET)"$(obj)"179 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) -vvv "$(obj)" 180 180 endef 181 181 -
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/VBoxBs3ObjConverter.cpp
r58719 r58806 496 496 497 497 498 #define PUBDEF UINT8_C(0x90) 499 #define THEADR UINT8_C(0x80) 500 #define EXTDEF UINT8_C(0x88) 501 #define SEGDEF UINT8_C(0x98) 502 #define LNAMES UINT8_C(0x96) 503 #define GRPDEF UINT8_C(0x9a) 504 #define REC32 UINT8_C(0x01) /**< Flag indicating 32-bit record. */ 505 506 /** 507 * Renames references to intrinsic helper functions so they won't clash between 508 * 32-bit and 16-bit code. 509 * 510 * @returns true / false. 511 * @param pszFile File name for complaining. 512 * @param pbFile Pointer to the file content. 513 * @param cbFile Size of the file content. 514 */ 515 static bool convertomf(const char *pszFile, uint8_t *pbFile, size_t cbFile) 516 { 517 const char **papchLNames = (const char **)calloc(sizeof(*papchLNames), _64K); 518 uint32_t cLNames = 0; 519 bool fProbably32bit = false; 520 uint32_t off; 521 522 while (off + 3 < cbFile) 523 { 524 uint8_t bRecType = pbFile[off]; 525 uint16_t cbRec = RT_MAKE_U16(pbFile[off + 1], pbFile[off + 2]); 526 if (g_cVerbose > 2) 527 printf( "%#07x: type=%#04x len=%#06x\n", off, bRecType, cbRec); 528 if (off + cbRec > cbFile) 529 return error(pszFile, "Invalid record length at %#x: %#x (cbFile=%#lx)\n", off, cbRec, (unsigned long)cbFile); 530 531 if (bRecType & REC32) 532 fProbably32bit = true; 533 534 uint32_t offRec = 0; 535 uint8_t *pbRec = &pbFile[off + 3]; 536 switch (bRecType) 537 { 538 /* 539 * Scan external definitions for intrinsics needing mangling. 540 */ 541 case EXTDEF: 542 { 543 break; 544 } 545 546 /* 547 * Record LNAME records, scanning for FLAT. 548 */ 549 case LNAMES: 550 { 551 while (offRec + 1 < cbRec) 552 { 553 uint8_t cch = *pbRec[offRec]; 554 if (offRec + 1 + cch >= cb) 555 { 556 } 557 } 558 break; 559 } 560 561 /* 562 * Display public names if -v is specified. 563 */ 564 case PUBDEF: 565 case PUBDEF | REC32: 566 if (g_cVerbose > 0) 567 { 568 569 } 570 break; 571 } 572 573 /* advance */ 574 off += cbRec + 3; 575 } 576 return true; 577 } 578 498 579 499 580 /** … … 523 604 && RT_MAKE_U16(pbFile[2], pbFile[3]) > 0) 524 605 fRc = convertcoff(pszFile, pbFile, cbFile); 606 else if ( cbFile >= 8 607 && pbFile[0] == THEADR 608 && RT_MAKE_U16(pbFile[1], pbFile[2]) < cbFile) 609 fRc = convertomf(pszFile, pbFile, cbFile); 525 610 else 526 611 fprintf(stderr, "error: Don't recognize format of '%s' (%#x %#x %#x %#x, cbFile=%lu)\n",
Note:
See TracChangeset
for help on using the changeset viewer.