4 ; Load an application's DLLs from the stub table
9 ;----- Standard stuff -------------------------------------------------------
14 ;----- Other external dependencies ------------------------------------------
16 IMPORT |x$stack_overflow|
19 IMPORT |_dll_giveMemory|
21 ;----- Main code ------------------------------------------------------------
23 AREA |DLL$$Code|,CODE,READONLY
25 ; --- _dll_findall ---
27 ; On entry: a1 == DLL$$ExternalTable$$Base
28 ; a2 == DLL$$ExternalTable$$Limit
35 ; --- APCS procedure entry ---
38 STMFD sp!,{fp,ip,lr,pc}
41 BLLT |x$stack_overflow|
43 ; --- Find the DLLs in the table ---
45 SWI DLL_FindFromTable ;Load DLLs in the app's table
47 ; --- Make sure the DLLs are freed at exit time ---
49 LDR a1,=|_dll_dying| ;Point to tidy up routine
50 BL atexit ;Add tidy-up routine to list
52 ; --- Give the DLLs some application space ---
54 LDMDB fp,{fp,sp,lr} ;Find registers again
55 B |_dll_giveMemory| ;Tail-call optimisation :-)
63 MOV ip,lr ;Keep link register safely
64 SWI DLL_AppDying ;Close down the application
65 MOVS pc,ip ;Return to caller
69 ;----- That's all, folks ----------------------------------------------------