Subversion Repositories Kolibri OS

Rev

Rev 9715 | Rev 9828 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9715 Rev 9823
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
4
;;  Distributed under terms of the GNU General Public License.  ;;
4
;;  Distributed under terms of the GNU General Public License.  ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 9715 $
8
$Revision: 9823 $
9
 
9
 
Line 285... Line 285...
285
 
285
 
286
align 4
286
align 4
Line 287... Line 287...
287
proc get_coff_sym stdcall, pSym:dword,count:dword, sz_sym:dword
287
proc get_coff_sym stdcall, pSym:dword,count:dword, sz_sym:dword
288
 
288
 
289
@@:
289
@@:
290
        stdcall strncmp, [pSym], [sz_sym], 8
290
        stdcall strncmp, [pSym], [sz_sym], sizeof.COFF_SYM.Name
291
        test    eax, eax
291
        test    eax, eax
292
        jz      .ok
292
        jz      .ok
293
        add     [pSym], 18
293
        add     [pSym], sizeof.COFF_SYM
294
        dec     [count]
294
        dec     [count]
295
        jnz     @b
295
        jnz     @b
296
        xor     eax, eax
296
        xor     eax, eax
297
        ret
297
        ret
298
.ok:
298
.ok:
299
        mov     eax, [pSym]
299
        mov     eax, [pSym]
300
        mov     eax, [eax+8]
300
        mov     eax, [eax+COFF_SYM.Value]
Line 301... Line 301...
301
        ret
301
        ret
302
endp
302
endp
Line 962... Line 962...
962
; calculate size of loaded DLL
962
; calculate size of loaded DLL
963
        mov     edx, [coff]
963
        mov     edx, [coff]
964
        movzx   ecx, [edx + COFF_HEADER.nSections]
964
        movzx   ecx, [edx + COFF_HEADER.nSections]
965
        xor     ebx, ebx
965
        xor     ebx, ebx
Line 966... Line 966...
966
 
966
 
967
        add     edx, 20
967
        add     edx, sizeof.COFF_HEADER
968
@@:
968
@@:
969
        call    coff_get_align
969
        call    coff_get_align
970
        add     ebx, eax
970
        add     ebx, eax
971
        not     eax
971
        not     eax
Line 1043... Line 1043...
1043
        mov     [esi + DLLDESCR.symbols_lim], edi
1043
        mov     [esi + DLLDESCR.symbols_lim], edi
1044
        add     ebx, edx
1044
        add     ebx, edx
1045
        movzx   ecx, [edx + COFF_HEADER.nSections]
1045
        movzx   ecx, [edx + COFF_HEADER.nSections]
1046
        lea     ecx, [ecx*5]
1046
        lea     ecx, [ecx*5]
1047
        lea     edi, [edi + ecx*8+20]
1047
        lea     edi, [edi + ecx*8+20]
1048
        add     edx, 20
1048
        add     edx, sizeof.COFF_HEADER
1049
@@:
1049
@@:
1050
        movzx   eax, [edx + COFF_SECTION.NumReloc]
1050
        movzx   eax, [edx + COFF_SECTION.NumReloc]
1051
        lea     eax, [eax*5]
1051
        lea     eax, [eax*5]
1052
        lea     edi, [edi + eax*2]
1052
        lea     edi, [edi + eax*2]
1053
        add     edx, sizeof.COFF_SECTION
1053
        add     edx, sizeof.COFF_SECTION
Line 1095... Line 1095...
1095
        pop     esi
1095
        pop     esi
Line 1096... Line 1096...
1096
 
1096
 
1097
; fixup symbols
1097
; fixup symbols
1098
        mov     edx, ebx
1098
        mov     edx, ebx
1099
        mov     eax, [ebx + COFF_HEADER.nSymbols]
1099
        mov     eax, [ebx + COFF_HEADER.nSymbols]
1100
        add     edx, 20
1100
        add     edx, sizeof.COFF_HEADER
1101
        mov     ecx, [esi + DLLDESCR.symbols_num]
1101
        mov     ecx, [esi + DLLDESCR.symbols_num]
1102
        lea     ecx, [ecx*9]
1102
        lea     ecx, [ecx*9]
1103
        add     ecx, ecx
1103
        add     ecx, ecx
Line 1182... Line 1182...
1182
        xor     edi, edi
1182
        xor     edi, edi
1183
        mov     ecx, [esi + DLLDESCR.data]
1183
        mov     ecx, [esi + DLLDESCR.data]
1184
        shr     ecx, 12
1184
        shr     ecx, 12
1185
.map_pages_loop:
1185
.map_pages_loop:
1186
        mov     eax, [page_tabs + ecx*4]
1186
        mov     eax, [page_tabs + ecx*4]
1187
        and     eax, not 0xFFF
1187
        and     eax, -PAGE_SIZE
1188
        or      al, PG_UR
1188
        or      al, PG_UR
1189
        xchg    eax, [page_tabs + edx*4]
1189
        xchg    eax, [page_tabs + edx*4]
1190
        test    al, 1
1190
        test    al, 1
1191
        jz      @f
1191
        jz      @f
1192
        call    free_page
1192
        call    free_page
1193
@@:
1193
@@:
1194
        invlpg  [ebx+edi]
1194
        invlpg  [ebx+edi]
1195
        inc     ecx
1195
        inc     ecx
1196
        inc     edx
1196
        inc     edx
1197
        add     edi, 0x1000
1197
        add     edi, PAGE_SIZE
1198
        cmp     edi, [esi + DLLDESCR.size]
1198
        cmp     edi, [esi + DLLDESCR.size]
1199
        jb      .map_pages_loop
1199
        jb      .map_pages_loop
Line 1200... Line 1200...
1200
 
1200
 
1201
; if real user-mode base is not equal to preferred base, relocate image
1201
; if real user-mode base is not equal to preferred base, relocate image