Skip to content

Commit

Permalink
changing name of labels for better ones
Browse files Browse the repository at this point in the history
  • Loading branch information
snf committed Mar 19, 2016
1 parent 793d6b4 commit ac36763
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ use llvm_assemble::assembler::{Arch, Reloc, assemble2};

fn main() {
let addr = 0x1000;
let reloc = Reloc::new("label0", 0x1003);
let bytes = assemble2(Arch::X86_64, "jmp label0", addr, &[reloc]).unwrap();
let label0 = Reloc::new("label0", 0x1003);
let bytes = assemble2(Arch::X86_64, "jmp label0", addr, &[label0]).unwrap();
assert_eq!(bytes, [0xeb, 0x01]);
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ fn x86_je() {
#[test]
fn x86_jmp_rel() {
let addr = 0x1000;
let reloc = Reloc::new("label0", 0x1003);
let bytes = assemble2(Arch::X86_64, "jmp label0", addr, &[reloc]).unwrap();
let label0 = Reloc::new("label0", 0x1003);
let bytes = assemble2(Arch::X86_64, "jmp label0", addr, &[label0]).unwrap();
assert_eq!(bytes, [0xeb, 0x01]);
}

Expand Down

0 comments on commit ac36763

Please sign in to comment.