You can see it near the beginning of the RTLs:
DLL entry code in RTL64.inc
% mode64bit
'=================
#ifdef dll
'=================
'
'DLL EQUATES
'
% DLL_PROCESS_ATTACH 1
% DLL_THREAD_ATTACH 2
% DLL_THREAD_DETACH 3
% DLL_PROCESS_DETACH 0
% DLL_PROCESS_VERIFIER 4
'
select rdx
case DLL_PROCESS_ATTACH : jmp fwd dll_start
case DLL_PROCESS_DETACH : jmp fwd dll_finish
case DLL_THREAD_ATTACH : mov rax,0 : ret
case DLL_THREAD_DETACH : mov rax,0 : ret
end select
mov rax,0
ret
'---------
dll_start:
'=========
'
jmp fwd prolog
'----------
dll_finish:
'==========
'
push rbx : push rsi : push rdi : push rax : push rbp
mov rbp,rsp
'
lea rip rbx,bssdata
'
! finish()
finish()
'
mov rax,0
mov rsp,rbp
pop rbp : add rsp,8 : pop rdi : pop rsi : pop rbx
ret
'==========
#endif 'DLL
'==========