Currently contents of .init_array, .fini_array, .ctors and .dtors is being sorted in Writer::finalizeSections, no matter if those sections are present in linker script or not.
This patch moves sorting of special sections to createSections(), which will allow defining symbols within such sections (required by FreeBSD and number of other projects)
Below is an example:
.init_array { __start = .; *(.init_array*) __end = .; }
See this review: