Commit Graph

5 Commits

Author SHA1 Message Date
Saleem Abdulrasool
76d7bfd8ed runtime: ensure that the module constructor element is RO
The default attribute on the section is read/write.  This would cause
the section to have different attributes when compiled.  The linker
would then preserve the section rather than merge it into the right
location.  This was noticed when linking with `link.exe`.
2018-02-02 15:01:44 -08:00
Saleem Abdulrasool
bb55044f38 runtime: add missing sw5prt to the section list
The Windows constructor was not populated properly, with the protocol
list being dropped.  Ensure that all the fields are initialised
properly.  Thanks to clang's `-Wmissing-field-initializers` warning to
help catch this.
2018-02-02 15:00:34 -08:00
Saleem Abdulrasool
bc950fd41a runtime: mark the section markers with the correct attributes
On windows, we create synthetic markers with grouping identifiers to
ensure that the markers are sorted properly and merged.  We would
previously mark the section as read/write rather than read-only causing
warnings when linking.  Correct the attributes.  This ensures the proper
linking of the modules.
2018-02-02 14:56:23 -08:00
Arnold Schwaighofer
8e71f34517 One more place I missed in the swift5 rename 2018-01-22 10:23:51 -08:00
Saleem Abdulrasool
899103cfa8 COFF: restructure metadata registration
Restructure the COFF metadata handling to use the linker section
grouping to emit section start/stop markers in the appropriate location.
This allows us to lookup the sections statically without having to the
walk the entire image structure.

Introduce a constructor for PE/COFF binaries.  This will ensure that the
registration occurs for all modules appropriately.  This should resolve
rdar://problem/19045112.  The registration should occur prior to
`DllMain` being invoked from `DllMainCRTStartup`.
2017-12-08 16:15:07 -08:00