m4b/faerie

Weak linkage support

bjorn3 opened this issue · 2 comments

My plan is to change the global :bool field in the relevant artifact::Decl variants to instead be scope: Scope where pub enum Scope { Local, Global, Weak }. I don't want to re-use the ELF term "binding" for this in the public API because its confusing, and there is already a concept of artifact::Binding in the library.

Based on my reading of goblin's mach code, it appears there is a flag to mark exports as weak definitions, so this scheme should be supportable with mach (https://github.com/m4b/goblin/blob/master/src/mach/exports.rs#L25). I'd love if someone could point me to reference materials on the mach file format. Unfortunately, I don't have access to a machine running Mac OS to test this, but I could probably convince my employer to send me a retired macbook.