diff options
-rw-r--r-- | src/bin/br.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bin/br.rs b/src/bin/br.rs index f2be2bf..9dcaaef 100644 --- a/src/bin/br.rs +++ b/src/bin/br.rs @@ -175,7 +175,13 @@ fn load_bytecode_from_bedrock_path(path: &Path) -> Option<Bytecode> { /// Attempt to load bytecode from a file path. fn load_bytecode_from_file(path: &Path) -> Result<Bytecode, std::io::Error> { - load_bytecode_from_readable_source(std::fs::File::open(path)?, Some(path)) + // Canonicalize paths so that symbolic links to program files resolve to + // the real program directory, which could contain a symbols file. + let path = match path.canonicalize() { + Ok(canonical) => canonical, + Err(_) => path.to_path_buf(), + }; + load_bytecode_from_readable_source(std::fs::File::open(&path)?, Some(&path)) } /// Attempt to load bytecode from standard input. |