2 * Written in the D programming language.
3 * This module provides Solaris-specific support for sections.
5 * Copyright: Copyright Martin Nowak 2012-2013.
6 * License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
7 * Authors: Martin Nowak
8 * Source: $(DRUNTIMESRC src/rt/_sections_solaris.d)
11 module rt.sections_solaris;
16 debug(PRINTF) import core.stdc.stdio;
17 import core.stdc.stdlib : malloc, free;
18 import rt.deh, rt.minfo;
22 static int opApply(scope int delegate(ref SectionGroup) dg)
27 static int opApplyReverse(scope int delegate(ref SectionGroup) dg)
32 @property immutable(ModuleInfo*)[] modules() const nothrow @nogc
34 return _moduleGroup.modules;
37 @property ref inout(ModuleGroup) moduleGroup() inout nothrow @nogc
42 @property immutable(FuncTable)[] ehTables() const nothrow @nogc
44 auto pbeg = cast(immutable(FuncTable)*)&__start_deh;
45 auto pend = cast(immutable(FuncTable)*)&__stop_deh;
46 return pbeg[0 .. pend - pbeg];
49 @property inout(void[])[] gcRanges() inout nothrow @nogc
55 ModuleGroup _moduleGroup;
59 void initSections() nothrow @nogc
61 auto mbeg = cast(immutable ModuleInfo**)&__start_minfo;
62 auto mend = cast(immutable ModuleInfo**)&__stop_minfo;
63 _sections.moduleGroup = ModuleGroup(mbeg[0 .. mend - mbeg]);
65 auto pbeg = cast(void*)&__dso_handle;
66 auto pend = cast(void*)&_end;
67 _sections._gcRanges[0] = pbeg[0 .. pend - pbeg];
70 void finiSections() nothrow @nogc
74 void[] initTLSRanges() nothrow @nogc
76 auto pbeg = cast(void*)&_tlsstart;
77 auto pend = cast(void*)&_tlsend;
78 return pbeg[0 .. pend - pbeg];
81 void finiTLSRanges(void[] rng) nothrow @nogc
85 void scanTLSRanges(void[] rng, scope void delegate(void* pbeg, void* pend) nothrow dg) nothrow
87 dg(rng.ptr, rng.ptr + rng.length);
92 __gshared SectionGroup _sections;
96 /* Symbols created by the compiler/linker and inserted into the
97 * object file that 'bracket' sections.