add macho dummy lib generation with ld

This commit is contained in:
Brendan Hansknecht 2022-10-22 23:23:09 -07:00
parent d6bdd2aec7
commit dead264798
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
3 changed files with 101 additions and 1 deletions

View file

@ -1,6 +1,7 @@
use target_lexicon::Triple;
mod elf64;
mod macho;
mod pe;
#[cfg(test)]
@ -14,7 +15,7 @@ pub(crate) use pe::APP_DLL;
pub fn generate(target: &Triple, custom_names: &[String]) -> object::read::Result<Vec<u8>> {
match target.binary_format {
target_lexicon::BinaryFormat::Elf => elf64::create_dylib_elf64(custom_names),
target_lexicon::BinaryFormat::Macho => todo!("macho dylib creation"),
target_lexicon::BinaryFormat::Macho => macho::create_dylib_macho(custom_names, target),
target_lexicon::BinaryFormat::Coff => Ok(pe::synthetic_dll(custom_names)),
other => unimplemented!("dylib creation for {:?}", other),
}