From de331b6305547331e8cebecfc77c43c1ff596bc2 Mon Sep 17 00:00:00 2001 From: MiroKaku <50670906+MiroKaku@users.noreply.github.com> Date: Mon, 27 Jun 2022 18:31:22 +0800 Subject: [PATCH] fix: merge sections --- src/crt/i386/ftol2.asm | 64 +++++++++++++++++----------------- src/crt/i386/ftol3.asm | 78 +++++++++++++++++++++--------------------- src/ucxxrt.cpp | 19 ++++++++++ 3 files changed, 90 insertions(+), 71 deletions(-) diff --git a/src/crt/i386/ftol2.asm b/src/crt/i386/ftol2.asm index 1b4b479..19062ae 100644 --- a/src/crt/i386/ftol2.asm +++ b/src/crt/i386/ftol2.asm @@ -9,31 +9,31 @@ ; Segment type: Zero-length ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 -_text$mn ends +_TEXT$mn segment para public 'CODE' use32 +_TEXT$mn ends ; Segment type: Zero-length ; Segment permissions: Read/Write -_data segment para public 'DATA' use32 -_data ends +_DATA segment para public 'DATA' use32 +_DATA ends ; Segment type: Pure data ; Segment permissions: Read -_rdata segment para public 'DATA' use32 - assume cs:_rdata +_RDATA segment readonly para public 'DATA' use32 + assume cs:_RDATA two32 dd 4F800000h two63 dd 5F000000h _NaN dd 0FFFFFFFFh -_rdata ends +_RDATA ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _ftol2_sse_excpt _ftol2_sse_excpt proc near @@ -41,13 +41,13 @@ _ftol2_sse_excpt proc near _ftol2_sse_excpt endp align 4 -_text$mn ends +_TEXT$mn ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _ftol2_sse _ftol2_sse proc near @@ -55,13 +55,13 @@ _ftol2_sse proc near _ftol2_sse endp align 4 -_text$mn ends +_TEXT$mn ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _ftoi2 _ftoi2 proc near @@ -119,14 +119,14 @@ L41: mov eax, 80000000h retn _ftoi2 endp -_text$mn ends +_TEXT$mn ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _ftoui2 _ftoui2 proc near @@ -202,13 +202,13 @@ L99: _ftoui2 endp align 4 -_text$mn ends +_TEXT$mn ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _ftol2 _ftol2 proc near @@ -284,13 +284,13 @@ L57: _ftol2 endp align 10h -_text$mn ends +_TEXT$mn ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _ftoul2 _ftoul2 proc near @@ -372,8 +372,8 @@ LAF: mov eax, 0FFFFFFFFh cdq retn -_ftoul2 endp -_text$mn ends +_ftoul2 endp +_TEXT$mn ends ; Segment type: Externs extrn __isa_available:dword diff --git a/src/crt/i386/ftol3.asm b/src/crt/i386/ftol3.asm index 3cb5bde..4dd7c8b 100644 --- a/src/crt/i386/ftol3.asm +++ b/src/crt/i386/ftol3.asm @@ -9,31 +9,31 @@ ; Segment type: Zero-length ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 -_text$mn ends +_TEXT$mn segment para public 'CODE' use32 +_TEXT$mn ends ; Segment type: Zero-length ; Segment permissions: Read/Write -_data segment para public 'DATA' use32 -_data ends +_DATA segment para public 'DATA' use32 +_DATA ends ; Segment type: Pure data ; Segment permissions: Read -_rdata segment para public 'DATA' use32 - assume cs:_rdata +_RDATA segment readonly para public 'DATA' use32 + assume cs:_RDATA _NaN dd 0FFFFFFFFh _onept5 dd 3FC00000h _DP2to32 dq 0 qword_18 dq 41F0000000000000h -_rdata ends +_RDATA ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _ftoui3 _ftoui3 proc near @@ -67,13 +67,13 @@ _ftoui3_NaN: _ftoui3 endp align 4 -_text$mn ends +_TEXT$mn ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _ftoul3 _ftoul3 proc near @@ -124,13 +124,13 @@ _ftoul3_NaN: _ftoul3 endp align 4 -_text$mn ends +_TEXT$mn ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _ftol3 _ftol3 proc near @@ -177,13 +177,13 @@ _ftol3_retmin: _ftol3 endp align 4 -_text$mn ends +_TEXT$mn ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _dtoui3 _dtoui3 proc near @@ -227,13 +227,13 @@ _dtoui3_NaN: dec eax retn _dtoui3 endp -_text$mn ends +_TEXT$mn ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _dtoul3 _dtoul3 proc near @@ -299,13 +299,13 @@ _dtoul3_NaN: _dtoul3 endp align 4 -_text$mn ends +_TEXT$mn ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _dtol3 _dtol3 proc near @@ -380,13 +380,13 @@ _dtol3_retmin: retn align 4 -_text$mn ends +_TEXT$mn ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _ultod3 _ultod3 proc near @@ -414,13 +414,13 @@ _ultod3_uint32: _ultod3 endp align 4 -_text$mn ends +_TEXT$mn ends ; Segment type: Pure code ; Segment permissions: Read/Execute -_text$mn segment para public 'CODE' use32 - assume cs:_text$mn - assume es:nothing, ss:nothing, ds:_data, fs:nothing, gs:nothing +_TEXT$mn segment para public 'CODE' use32 + assume cs:_TEXT$mn + assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing public _ltod3 _ltod3 proc near @@ -441,7 +441,7 @@ _ltod3_default: addsd xmm0, xmm1 retn _ltod3 endp -_text$mn ends +_TEXT$mn ends ; Segment type: Externs extrn __isa_available:dword diff --git a/src/ucxxrt.cpp b/src/ucxxrt.cpp index efdb34d..4d40d81 100644 --- a/src/ucxxrt.cpp +++ b/src/ucxxrt.cpp @@ -1,2 +1,21 @@ +/* + * PROJECT: Universal C++ RunTime (UCXXRT) + * FILE: ucxxrt.cpp + * DATA: 2022/06/27 + * + * PURPOSE: Universal C++ RunTime + * + * LICENSE: Relicensed under The MIT License from The CC BY 4.0 License + * + * DEVELOPER: MiroKaku (miro.kaku AT Outlook.com) + */ + +// Section +#pragma comment(linker, "/merge:_TEXT=.text") +#pragma comment(linker, "/merge:_DATA=.data") +#pragma comment(linker, "/merge:_RDATA=.rdata") + + +// Global extern"C" ULONG __ucxxrt_tag = static_cast(_ByteSwap32('ucrt'));