mmastrac / rust-ctor

Module initialization/global constructor functions for Rust
Apache License 2.0
739 stars 49 forks source link

Mention correct `link_section` in docs for Apple #303

Closed BertalanD closed 1 month ago

BertalanD commented 3 months ago

The code is correct by putting it actually in __DATA; update the docs to match that.

The assembler only sets the S_MOD_INIT_FUNC_POINTERS section flag if the __DATA segment is used, and without that, dyld will just ignore it. It's the linker's job to move it to __DATA_CONST when targetting a new enough OS version.

mmastrac commented 1 month ago

Merged, thanks!