Changeset 79561 in vbox for trunk/src/VBox/Runtime/r3/posix
- Timestamp:
- Jul 5, 2019 7:37:47 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp
r79559 r79561 141 141 Assert(strchr(pszFilename, '/') == NULL); 142 142 143 /* Easy if suffix was included. */ 143 uint32_t const fFlags2 = fFlags & ~(RTLDRLOAD_FLAGS_SO_VER_BEGIN_MASK | RTLDRLOAD_FLAGS_SO_VER_END_MASK); 144 145 /* 146 * If no suffix is given and we haven't got any RTLDRLOAD_FLAGS_SO_VER_ range to work 147 * with, we can call RTLdrLoadEx directly. 148 */ 144 149 if (!pszExt) 145 return RTLdrLoadEx(pszFilename, phLdrMod, fFlags, NULL); 150 { 151 #if !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2) && !defined(RT_OS_WINDOWS) 152 if ( (fFlags & RTLDRLOAD_FLAGS_SO_VER_BEGIN_MASK) >> RTLDRLOAD_FLAGS_SO_VER_BEGIN_SHIFT 153 == (fFlags & RTLDRLOAD_FLAGS_SO_VER_END_MASK) >> RTLDRLOAD_FLAGS_SO_VER_END_SHIFT) 154 #endif 155 return RTLdrLoadEx(pszFilename, phLdrMod, fFlags2, NULL); 156 pszExt = ""; 157 } 146 158 147 /* Combine filename and suffix and then do the loading. */ 159 /* 160 * Combine filename and suffix and then do the loading. 161 */ 148 162 size_t const cchFilename = strlen(pszFilename); 149 163 size_t const cchSuffix = strlen(pszExt); … … 153 167 pszTmp[cchFilename + cchSuffix] = '\0'; 154 168 155 int rc = RTLdrLoadEx(pszTmp, phLdrMod, fFlags , NULL);169 int rc = RTLdrLoadEx(pszTmp, phLdrMod, fFlags2, NULL); 156 170 157 171 #if !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2) && !defined(RT_OS_WINDOWS) … … 165 179 if (pszActualSuff && strcmp(pszActualSuff, ".so") == 0) 166 180 { 167 uint32_t const uBegin= (fFlags & RTLDRLOAD_FLAGS_SO_VER_BEGIN_MASK) >> RTLDRLOAD_FLAGS_SO_VER_BEGIN_SHIFT;168 uint32_t const uEnd= (fFlags & RTLDRLOAD_FLAGS_SO_VER_END_MASK) >> RTLDRLOAD_FLAGS_SO_VER_END_SHIFT;169 int32_t const iIncr = uBegin <= uEnd ? 1 : -1;170 for ( uint32_t uMajorVer = uBegin; uMajorVer != uEnd; uMajorVer += iIncr)181 int32_t const iBegin = (fFlags & RTLDRLOAD_FLAGS_SO_VER_BEGIN_MASK) >> RTLDRLOAD_FLAGS_SO_VER_BEGIN_SHIFT; 182 int32_t const iEnd = (fFlags & RTLDRLOAD_FLAGS_SO_VER_END_MASK) >> RTLDRLOAD_FLAGS_SO_VER_END_SHIFT; 183 int32_t const iIncr = iBegin <= iEnd ? 1 : -1; 184 for (int32_t iMajorVer = iBegin; iMajorVer != iEnd; iMajorVer += iIncr) 171 185 { 172 RTStrPrintf(&pszTmp[cchFilename + cchSuffix], 16 + 1, ".% u", uMajorVer);173 rc = RTLdrLoadEx(pszTmp, phLdrMod, fFlags , NULL);186 RTStrPrintf(&pszTmp[cchFilename + cchSuffix], 16 + 1, ".%d", iMajorVer); 187 rc = RTLdrLoadEx(pszTmp, phLdrMod, fFlags2, NULL); 174 188 if (RT_SUCCESS(rc)) 175 189 break;
Note:
See TracChangeset
for help on using the changeset viewer.