- Timestamp:
- Oct 7, 2018 1:00:04 PM (6 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile.kmk
r74653 r74654 1967 1967 ## @todo change this to EXTEND the RuntimeR3 target. 1968 1968 RuntimeGuestR3_SDKS.win := $(RuntimeR3_SDKS.win) 1969 RuntimeGuestR3_DEFS := $(filter-out RTCRITSECT_STRICT RT_NO_GIP IPRT_WITH_OPENSSL LDR_WITH_KLDR, $(RuntimeR3_DEFS))1970 RuntimeGuestR3_DEFS := $(filter-out IN_SUP_R3, $(RuntimeGuestR3_DEFS)) ## @todo r=andy Needed to make cross-building with RTLdr API work.1969 RuntimeGuestR3_DEFS := $(filter-out RTCRITSECT_STRICT RT_NO_GIP IPRT_WITH_OPENSSL, $(RuntimeR3_DEFS)) 1970 RuntimeGuestR3_DEFS := $(filter-out IN_SUP_R3, $(RuntimeGuestR3_DEFS)) 1971 1971 RuntimeGuestR3_DEFS.$(KBUILD_TARGET) := $(RuntimeR3_DEFS.$(KBUILD_TARGET)) 1972 1972 RuntimeGuestR3_DEFS.$(KBUILD_HOST) := $(RuntimeR3_DEFS.$(KBUILD_HOST)) -
trunk/src/VBox/Runtime/VBox/VBoxRTImp.def
r74329 r74654 1166 1166 RTLdrLoadAppPriv 1167 1167 RTLdrOpen 1168 RTLdrOpenkLdr1169 1168 RTLdrRelocate 1170 1169 RTLdrSize -
trunk/src/VBox/Runtime/common/ldr/ldrEx.cpp
r74638 r74654 47 47 #ifdef LDR_ONLY_PE 48 48 # undef LDR_WITH_PE 49 # undef LDR_WITH_KLDR50 49 # undef LDR_WITH_ELF 51 50 # undef LDR_WITH_LX 52 51 # undef LDR_WITH_LE 52 # undef LDR_WITH_MACHO 53 53 # undef LDR_WITH_NE 54 54 # undef LDR_WITH_MZ … … 78 78 if (RT_FAILURE(rc)) 79 79 return rc; 80 #ifndef LDR_WITH_KLDR81 80 if ( uSign.au16[0] != IMAGE_DOS_SIGNATURE 82 81 && uSign.u32 != IMAGE_NT_SIGNATURE … … 93 92 return VERR_INVALID_EXE_SIGNATURE; 94 93 } 95 #endif96 94 uint32_t offHdr = 0; 97 95 if (uSign.au16[0] == IMAGE_DOS_SIGNATURE) … … 184 182 else 185 183 { 186 #ifndef LDR_WITH_KLDR187 184 Log(("rtldrOpenWithReader: %s: the format isn't implemented %#x / '%.4s\n", pReader->pfnLogName(pReader), uSign.u32, &uSign.ach[0])); 188 #endif189 185 rc = VERR_INVALID_EXE_SIGNATURE; 190 186 } 191 192 #ifdef LDR_WITH_KLDR193 /* Try kLdr if it's a format we don't recognize. */194 if (rc <= VERR_INVALID_EXE_SIGNATURE && rc > VERR_BAD_EXE_FORMAT)195 {196 int rc2 = rtldrkLdrOpen(pReader, fFlags, enmArch, phMod, pErrInfo);197 if ( RT_SUCCESS(rc2)198 || (rc == VERR_INVALID_EXE_SIGNATURE && rc2 != VERR_MZ_EXE_NOT_SUPPORTED /* Quick fix for bad return code. */)199 || rc2 > VERR_INVALID_EXE_SIGNATURE200 || rc2 <= VERR_BAD_EXE_FORMAT)201 rc = rc2;202 }203 #endif204 187 205 188 LogFlow(("rtldrOpenWithReader: %s: returns %Rrc *phMod=%p\n", pReader->pfnLogName(pReader), rc, *phMod)); -
trunk/src/VBox/Runtime/common/ldr/ldrFile.cpp
r69111 r74654 296 296 RT_EXPORT_SYMBOL(RTLdrOpenEx); 297 297 298 299 /**300 * Opens a binary image file using kLdr.301 *302 * @returns iprt status code.303 * @param pszFilename Image filename.304 * @param fFlags Reserved, MBZ.305 * @param enmArch CPU architecture specifier for the image to be loaded.306 * @param phLdrMod Where to store the handle to the loaded module.307 * @remark Primarily for testing the loader.308 */309 RTDECL(int) RTLdrOpenkLdr(const char *pszFilename, uint32_t fFlags, RTLDRARCH enmArch, PRTLDRMOD phLdrMod)310 {311 #ifdef LDR_WITH_KLDR312 LogFlow(("RTLdrOpenkLdr: pszFilename=%p:{%s} fFlags=%#x enmArch=%d phLdrMod=%p\n",313 pszFilename, pszFilename, fFlags, enmArch, phLdrMod));314 AssertMsgReturn(!(fFlags & ~RTLDR_O_VALID_MASK), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);315 316 /*317 * Create file reader & invoke worker which identifies and calls the image interpreter.318 */319 PRTLDRREADER pReader;320 int rc = rtldrFileCreate(&pReader, pszFilename);321 if (RT_SUCCESS(rc))322 {323 rc = rtldrkLdrOpen(pReader, fFlags, enmArch, phLdrMod, NULL);324 if (RT_SUCCESS(rc))325 {326 LogFlow(("RTLdrOpenkLdr: return %Rrc *phLdrMod=%p\n", rc, *phLdrMod));327 return rc;328 }329 pReader->pfnDestroy(pReader);330 }331 *phLdrMod = NIL_RTLDRMOD;332 LogFlow(("RTLdrOpenkLdr: return %Rrc\n", rc));333 return rc;334 335 #else336 return RTLdrOpen(pszFilename, fFlags, enmArch, phLdrMod);337 #endif338 }339 RT_EXPORT_SYMBOL(RTLdrOpenkLdr);340 -
trunk/src/VBox/Runtime/common/ldr/ldrVfsFile.cpp
r73097 r74654 278 278 PRTLDRMOD phLdrMod, uint32_t *poffError, PRTERRINFO pErrInfo) 279 279 { 280 #ifdef LDR_WITH_KLDR281 LogFlow(("RTLdrOpenVfsChainkLdr: pszFilename=%p:{%s} fFlags=%#x enmArch=%d phLdrMod=%p\n",282 pszFilename, pszFilename, fFlags, enmArch, phLdrMod));283 AssertMsgReturn(!(fFlags & ~RTLDR_O_VALID_MASK), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);284 285 /*286 * Create file reader & invoke worker which identifies and calls the image interpreter.287 */288 PRTLDRREADER pReader;289 int rc = rtldrVfsFileCreate(pszFilename, &pReader, poffError, pErrInfo);290 if (RT_SUCCESS(rc))291 {292 if (poffError)293 *poffError = 0;294 rc = rtldrkLdrOpen(pReader, fFlags, enmArch, phLdrMod, pErrInfo);295 if (RT_SUCCESS(rc))296 {297 LogFlow(("RTLdrOpenkLdr: return %Rrc *phLdrMod=%p\n", rc, *phLdrMod));298 return rc;299 }300 pReader->pfnDestroy(pReader);301 }302 *phLdrMod = NIL_RTLDRMOD;303 LogFlow(("RTLdrOpenVfsChainkLdr: return %Rrc\n", rc));304 return rc;305 306 #else307 280 return RTLdrOpenVfsChain(pszFilename, fFlags, enmArch, phLdrMod, poffError, pErrInfo); 308 #endif309 281 } 310 282 RT_EXPORT_SYMBOL(RTLdrOpenVfsChainkLdr); -
trunk/src/VBox/Runtime/testcase/tstLdr-4.cpp
r69111 r74654 117 117 { NULL, NULL, 0, "bar" }, 118 118 { NULL, NULL, 0, "foobar" }, 119 { NULL, NULL, 0, "kLdr-foo" },120 { NULL, NULL, 0, "kLdr-bar" },121 { NULL, NULL, 0, "kLdr-foobar" }122 119 }; 123 120 unsigned i; … … 129 126 for (i = 0; i < RT_ELEMENTS(aLoads); i++) 130 127 { 131 if (!strncmp(aLoads[i].pszName, RT_STR_TUPLE("kLdr-"))) 132 { 133 rc = RTLdrOpenkLdr(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod); 134 if (rc == VERR_ELF_EXE_NOT_SUPPORTED) 135 continue; 136 } 137 else 138 rc = RTLdrOpen(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod); 128 rc = RTLdrOpen(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod); 139 129 if (RT_FAILURE(rc)) 140 130 { -
trunk/src/VBox/Runtime/testcase/tstLdr.cpp
r69111 r74654 106 106 { NULL, NULL, (RTUINTPTR)0x40404040, "bar" }, 107 107 { NULL, NULL, (RTUINTPTR)0xefefef00, "foobar" }, 108 { NULL, NULL, (RTUINTPTR)0xefefef00, "kLdr-foo" },109 { NULL, NULL, (RTUINTPTR)0x40404040, "kLdr-bar" },110 { NULL, NULL, (RTUINTPTR)0xefefef00, "kLdr-foobar" }111 108 }; 112 109 unsigned i; … … 123 120 124 121 /* open it */ 125 int rc; 126 if (!strncmp(aLoads[i].pszName, RT_STR_TUPLE("kLdr-"))) 127 rc = RTLdrOpenkLdr(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod); 128 else 129 rc = RTLdrOpen(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod); 122 int rc = RTLdrOpen(pszFilename, 0, RTLDRARCH_WHATEVER, &aLoads[i].hLdrMod); 130 123 if (RT_FAILURE(rc)) 131 124 {
Note:
See TracChangeset
for help on using the changeset viewer.