do some registers

This commit is contained in:
nora 2023-07-08 21:07:42 +02:00
parent a363b7c6d1
commit e28469fcc0
9 changed files with 227 additions and 97 deletions

View file

@ -1,3 +1,4 @@
mod registers;
mod x86_64;
use std::process::Stdio;
@ -18,6 +19,13 @@ pub fn generate<'cx>(lcx: &'cx LoweringCx<'cx>, ir: &Ir<'cx>) -> Result<()> {
object::Endianness::Little,
);
// GNU linkers have this awesome thing where they'll mark your stack as executable unless you tell them not to.
obj.add_section(
Vec::new(),
b".note.GNU-stack".to_vec(),
object::SectionKind::Note,
);
let text = obj.add_section(Vec::new(), b".text".to_vec(), object::SectionKind::Text);
for func in ir.funcs.values() {