- Timestamp:
- Apr 7, 2024 4:29:33 PM (10 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asmdefs-arm.h
r100276 r104213 145 145 #if defined(__clang__) 146 146 # define PAGE(a_Symbol) a_Symbol ## @PAGE 147 #elif defined(__GNUC__) 148 # define PAGE(a_Symbol) a_Symbol147 #elif defined(__GNUC__) && defined(ASM_FORMAT_ELF) 148 # define PAGE(a_Symbol) :got: ## a_Symbol 149 149 #else 150 150 # error "Port me!" … … 159 159 #if defined(__clang__) 160 160 # define PAGEOFF(a_Symbol) a_Symbol ## @PAGEOFF 161 #elif defined(__GNUC__) 162 # define PAGEOFF(a_Symbol) : lo12: ## a_Symbol161 #elif defined(__GNUC__) && defined(ASM_FORMAT_ELF) 162 # define PAGEOFF(a_Symbol) :got_lo12: ## a_Symbol 163 163 #else 164 164 # error "Port me!" -
trunk/src/bldprogs/VBoxDef2LazyLoad.cpp
r100275 r104213 1230 1230 "___LazyLoad___%s:\n" 1231 1231 " adrp x9, PAGE(g_sz%s)\n" 1232 "#ifndef ASM_FORMAT_ELF\n" 1232 1233 " add x9, x9, PAGEOFF(g_sz%s)\n" 1234 "#else\n" 1235 " ldr x9, [x9, PAGEOFF(g_sz%s)]\n" 1236 "#endif\n" 1233 1237 " adrp x10, PAGE(NAME(%s%s))\n" 1238 "#ifndef ASM_FORMAT_ELF\n" 1234 1239 " add x10, x10, PAGEOFF(NAME(%s%s))\n" 1240 "#else\n" 1241 " ldr x10, [x10, PAGEOFF(NAME(%s%s))]\n" 1242 "#endif\n" 1235 1243 " mov x16, x30\n" 1236 1244 " bl LazyLoadResolver\n" 1237 1245 " mov x30, x16\n" 1238 1246 , pExp->pszExportedNm, 1239 pExp->pszExportedNm, pExp->pszExportedNm, 1247 pExp->pszExportedNm, pExp->pszExportedNm, pExp->pszExportedNm, 1248 !pExp->fData ? "g_pfn" : "g_LazyPtr_", pExp->pszExportedNm, 1240 1249 !pExp->fData ? "g_pfn" : "g_LazyPtr_", pExp->pszExportedNm, 1241 1250 !pExp->fData ? "g_pfn" : "g_LazyPtr_", pExp->pszExportedNm); … … 1245 1254 " movk w9, #%u\n" 1246 1255 " adrp x10, PAGE(NAME(%s%s))\n" 1256 "#ifndef ASM_FORMAT_ELF\n" 1247 1257 " add x10, x10, PAGEOFF(NAME(%s%s))\n" 1258 "#else\n" 1259 " ldr x10, [x10, PAGEOFF(NAME(%s%s))]\n" 1260 "#endif\n" 1248 1261 , pExp->pszExportedNm, 1249 1262 pExp->uOrdinal, 1263 !pExp->fData ? "g_pfn" : "g_LazyPtr_", pExp->pszExportedNm, 1250 1264 !pExp->fData ? "g_pfn" : "g_LazyPtr_", pExp->pszExportedNm, 1251 1265 !pExp->fData ? "g_pfn" : "g_LazyPtr_", pExp->pszExportedNm); … … 1344 1358 " mov x3, x0\n" 1345 1359 " adrp x2, PAGE(g_szLibrary)\n" 1360 "#ifndef ASM_FORMAT_ELF\n" 1346 1361 " add x2, x2, PAGEOFF(g_szLibrary)\n" 1362 "#else\n" 1363 " ldr x2, [x2, PAGEOFF(g_szLibrary)]\n" 1364 "#endif\n" 1347 1365 " mov x1, x19\n" 1348 1366 " adrp x0, PAGE(g_szFailLoadFmt)\n" 1367 "#ifndef ASM_FORMAT_ELF\n" 1349 1368 " add x0, x0, PAGEOFF(g_szFailLoadFmt)\n" 1369 "#else\n" 1370 " ldr x0, [x0, PAGEOFF(g_szFailLoadFmt)]\n" 1371 "#endif\n" 1350 1372 " stp x1, x2, [sp]\n" 1351 1373 " str x3, [sp, #16]\n" … … 1415 1437 " mov x2, #0\n" 1416 1438 " adrp x1, PAGE(g_hMod)\n" 1439 "#ifndef ASM_FORMAT_ELF\n" 1417 1440 " add x1, x1, PAGEOFF(g_hMod)\n" 1441 "#else\n" 1442 " ldr x1, [x1, PAGEOFF(g_hMod)]\n" 1443 "#endif\n" 1418 1444 " adrp x0, PAGE(g_szLibrary)\n" 1445 "#ifndef ASM_FORMAT_ELF\n" 1419 1446 " add x0, x0, PAGEOFF(g_szLibrary)\n" 1447 "#else\n" 1448 " ldr x0, [x0, PAGEOFF(g_szLibrary)]\n" 1449 "#endif\n" 1420 1450 " bl NAME(SUPR3HardenedLdrLoadAppPriv)\n"); 1421 1451 else … … 1423 1453 " /* Call RTLdrLoadSystem(const char *pszFilename, bool fNoUnload, PRTLDRMOD phLdrMod); */\n" 1424 1454 " adrp x2, PAGE(g_hMod)\n" 1455 "#ifndef ASM_FORMAT_ELF\n" 1425 1456 " add x2, x2, PAGEOFF(g_hMod)\n" 1457 "#else\n" 1458 " ldr x2, [x2, PAGEOFF(g_hMod)]\n" 1459 "#endif\n" 1426 1460 " mov x1, #1\n" 1427 1461 " adrp x0, PAGE(g_szLibrary)\n" 1462 "#ifndef ASM_FORMAT_ELF\n" 1428 1463 " add x0, x0, PAGEOFF(g_szLibrary)\n" 1464 "#else\n" 1465 " ldr x0, [x0, PAGEOFF(g_szLibrary)]\n" 1466 "#endif\n" 1429 1467 " bl NAME(RTLdrLoadSystem)\n"); 1430 1468 … … 1436 1474 " mov x2, x0\n" 1437 1475 " adrp x1, PAGE(g_szLibrary)\n" 1476 "#ifndef ASM_FORMAT_ELF\n" 1438 1477 " add x1, x1, PAGEOFF(g_szLibrary)\n" 1478 "#else\n" 1479 " ldr x1, [x1, PAGEOFF(g_szLibrary)]\n" 1480 "#endif\n" 1439 1481 " adrp x0, PAGE(g_szFailResolveFmt)\n" 1482 "#ifndef ASM_FORMAT_ELF\n" 1440 1483 " add x0, x0, PAGEOFF(g_szFailResolveFmt)\n" 1484 "#else\n" 1485 " ldr x0, [x0, PAGEOFF(g_szFailResolveFmt)]\n" 1486 "#endif\n" 1441 1487 " stp x1, x2, [sp]\n" 1442 1488 " bl NAME(RTAssertMsg2Weak)\n" … … 1512 1558 " mov x2, #0\n" 1513 1559 " adrp x1, PAGE(g_hMod)\n" 1560 "#ifndef ASM_FORMAT_ELF\n" 1514 1561 " add x1, x1, PAGEOFF(g_hMod)\n" 1562 "#else\n" 1563 " ldr x1, [x1, PAGEOFF(g_hMod)]\n" 1564 "#endif\n" 1515 1565 " adrp x0, PAGE(g_szLibrary)\n" 1566 "#ifndef ASM_FORMAT_ELF\n" 1516 1567 " add x0, x0, PAGEOFF(g_szLibrary)\n" 1568 "#else\n" 1569 " ldr x0, [x0, PAGEOFF(g_szLibrary)]\n" 1570 "#endif\n" 1517 1571 " bl NAME(SUPR3HardenedLdrLoadAppPriv)\n"); 1518 1572 else … … 1520 1574 " /* Call RTLdrLoadSystem(const char *pszFilename, bool fNoUnload, PRTLDRMOD phLdrMod); */\n" 1521 1575 " adrp x2, PAGE(g_hMod)\n" 1576 "#ifndef ASM_FORMAT_ELF\n" 1522 1577 " add x2, x2, PAGEOFF(g_hMod)\n" 1578 "#else\n" 1579 " ldr x2, [x2, PAGEOFF(g_hMod)]\n" 1580 "#endif\n" 1523 1581 " mov x1, #1\n" 1524 1582 " adrp x0, PAGE(g_szLibrary)\n" 1583 "#ifndef ASM_FORMAT_ELF\n" 1525 1584 " add x0, x0, PAGEOFF(g_szLibrary)\n" 1585 "#else\n" 1586 " ldr x0, [x0, PAGEOFF(g_szLibrary)]\n" 1587 "#endif\n" 1526 1588 " bl NAME(RTLdrLoadSystem)\n"); 1527 1589 fprintf(pOutput, … … 1539 1601 "\n" 1540 1602 " adrp x22, PAGE(g_szzNames)\n" 1603 "#ifndef ASM_FORMAT_ELF\n" 1541 1604 " add x22, x22, PAGEOFF(g_szzNames)\n" 1605 "#else\n" 1606 " ldr x22, [x22, PAGEOFF(g_szzNames)]\n" 1607 "#endif\n" 1542 1608 " adrp x23, PAGE(g_apfnImports)\n" 1609 "#ifndef ASM_FORMAT_ELF\n" 1543 1610 " add x23, x23, PAGEOFF(g_apfnImports)\n" 1611 "#else\n" 1612 " ldr x23, [x23, PAGEOFF(g_apfnImports)]\n" 1613 "#endif\n" 1544 1614 "Lexplicit_load_next_import:\n" 1545 1615 " ldr x0, [x23]\n"
Note:
See TracChangeset
for help on using the changeset viewer.