Skip to content

Commit

Permalink
Mv obtaining of output_path just before usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Urhengulas committed Apr 1, 2021
1 parent 3641017 commit 8fd8c82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ fn main() -> anyhow::Result<()> {

let current_dir = env::current_dir()?;
let linker_scripts = get_linker_scripts(&args, &current_dir)?;
let output_path = argument_parser::get_output_path(&args)?;

// here we assume that we'll end with the same linker script as LLD
// I'm unsure about how LLD picks a linker script when there are multiple candidates in the
Expand All @@ -45,6 +44,7 @@ fn main() -> anyhow::Result<()> {
let (ram_linker_script, ram_entry) = ram_path_entry
.ok_or_else(|| anyhow!("MEMORY.RAM not found after scanning linker scripts"))?;

let output_path = argument_parser::get_output_path(&args)?;
let elf = fs::read(output_path)?;
let object = object::File::parse(&elf)?;

Expand Down

0 comments on commit 8fd8c82

Please sign in to comment.