1 diff --git a/src/core/memory.d b/src/core/memory.d
2 index 0a427055..28408cb7 100644
3 --- a/src/core/memory.d
4 +++ b/runtime/druntime/src/core/memory.d
7 * Notes_to_implementors:
9 - * $(LI On POSIX systems, the signals SIGUSR1 and SIGUSR2 are reserved
10 + * $(LI On POSIX systems, the signals `SIGRTMIN` and `SIGRTMIN + 1` are reserved
11 * by this module for use in the garbage collector implementation.
12 * Typically, they will be used to stop and resume other threads
13 * when performing a collection, but an implementation may choose
14 diff --git a/src/core/thread.d b/src/core/thread.d
15 index 64e6dc18..2c08e6db 100644
16 --- a/src/core/thread.d
17 +++ b/runtime/druntime/src/core/thread.d
18 @@ -1922,7 +1922,7 @@ version( CoreDdoc )
21 * Instruct the thread module, when initialized, to use a different set of
22 - * signals besides SIGUSR1 and SIGUSR2 for suspension and resumption of threads.
23 + * signals besides `SIGRTMIN` and `SIGRTMIN + 1` for suspension and resumption of threads.
24 * This function should be called at most once, prior to thread_init().
25 * This function is Posix-only.
27 @@ -1980,12 +1980,13 @@ extern (C) void thread_init()
29 if( suspendSignalNumber == 0 )
31 - suspendSignalNumber = SIGUSR1;
32 + suspendSignalNumber = SIGRTMIN;
35 if( resumeSignalNumber == 0 )
37 - resumeSignalNumber = SIGUSR2;
38 + resumeSignalNumber = SIGRTMIN + 1;
39 + assert(resumeSignalNumber <= SIGRTMAX);
43 @@ -3975,6 +3976,10 @@ version( LDC )
44 version( X86 ) version = CheckFiberMigration;
45 version( X86_64 ) version = CheckFiberMigration;
49 + version( ARM ) version = CheckFiberMigration;
53 // Fiber support for SjLj style exceptions
54 diff --git a/src/rt/sections_android.d b/src/rt/sections_android.d
55 index 60ca9a9a..a662887d 100644
56 --- a/src/rt/sections_android.d
57 +++ b/runtime/druntime/src/rt/sections_android.d
58 @@ -62,12 +62,9 @@ private:
61 pthread_key_create(&_tlsKey, null);
62 + _sections.moduleGroup = ModuleGroup(getModuleInfos());
64 - auto mbeg = cast(immutable ModuleInfo**)&__start_minfo;
65 - auto mend = cast(immutable ModuleInfo**)&__stop_minfo;
66 - _sections.moduleGroup = ModuleGroup(mbeg[0 .. mend - mbeg]);
68 - auto pbeg = cast(void*)&_tls_end;
69 + auto pbeg = cast(void*)&_tlsend;
70 auto pend = cast(void*)&__bss_end__;
71 _sections._gcRanges[0] = pbeg[0 .. pend - pbeg];
73 @@ -167,6 +164,38 @@ ref void[] getTLSBlockAlloc()
75 __gshared SectionGroup _sections;
77 +// This linked list is created by a compiler generated function inserted
78 +// into the .ctor list by the compiler.
79 +struct ModuleReference
81 + ModuleReference* next;
85 +extern (C) __gshared immutable(ModuleReference*) _Dmodule_ref; // start of linked list
87 +immutable(ModuleInfo*)[] getModuleInfos()
96 + immutable(ModuleReference)* mr;
98 + for (mr = _Dmodule_ref; mr; mr = mr.next)
100 + auto result = (cast(immutable(ModuleInfo)**).malloc(len * size_t.sizeof))[0 .. len];
102 + for (mr = _Dmodule_ref; mr; mr = mr.next)
103 + { result[len] = mr.mod;
106 + return cast(immutable)result;
111 /* Symbols created by the compiler/linker and inserted into the
112 @@ -174,10 +203,8 @@ extern(C)
118 - void* __start_minfo;
119 - void* __stop_minfo;