Skip to content

Commit

Permalink
Merge pull request #79 from knurling-rs/cleanup
Browse files Browse the repository at this point in the history
Summer cleanup
  • Loading branch information
Urhengulas committed Jul 20, 2023
2 parents 6bf32b1 + 8fa745b commit 2635a67
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 60 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- [#79]: Summer cleanup
- [#77]: CI: Switch from bors to github merge queue
- [#75]: End of year refactoring
- [#74]: CI: Simplify
- [#72]: CI: Install Rust manually
- [#71]: CI: Add changelog enforcer
- [#70]: Support addition in ORIGIN

[#77]: https://github.com/knurling-rs/flip-link/pull/xx
[#79]: https://github.com/knurling-rs/flip-link/pull/79
[#77]: https://github.com/knurling-rs/flip-link/pull/77
[#75]: https://github.com/knurling-rs/flip-link/pull/75
[#74]: https://github.com/knurling-rs/flip-link/pull/74
[#72]: https://github.com/knurling-rs/flip-link/pull/72
Expand Down
145 changes: 95 additions & 50 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ readme = "README.md"
env_logger = { version = "0.10", default-features = false }
getrandom = "0.2"
log = "0.4"
object = { version = "0.30", default-features = false, features = ["read_core", "elf", "std"] }
object = { version = "0.31", default-features = false, features = ["read_core", "elf", "std"] }

[dev-dependencies]
assert_cmd = "2.0"
rstest = { version = "0.16", default-features = false }
rstest = { version = "0.18", default-features = false }

[workspace]
members = [".", "xtest"]
4 changes: 2 additions & 2 deletions src/argument_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ pub fn get_search_paths(args: &[String]) -> Vec<PathBuf> {
args.windows(2)
.filter_map(|x| (x[0] == "-L").then(|| PathBuf::from(&x[1])))
.inspect(|path| log::trace!("new search path: {}", path.display()))
.collect::<Vec<_>>()
.collect()
}

/// Get `search_targets`, the names of the linker scripts, specified by `-T`
pub fn get_search_targets(args: &[String]) -> Vec<Cow<str>> {
args.iter()
.filter_map(|arg| arg.strip_prefix("-T").map(Cow::Borrowed))
.collect::<Vec<_>>()
.collect()
}
6 changes: 3 additions & 3 deletions src/linking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ pub fn link_normally(args: &[String]) -> io::Result<ExitStatus> {
///
/// * `args` are arguments passed to the linker invocation
/// * `current_dir` is the directory from which the linker was invoked
/// * `stack_start` is the new, custom starting point from which our stack grows downwards–
/// * this should be right *below* the `.bss+.data` region that we've moved to the top, e.g.:
/// * `custom_linker_script_dir` is the directory in which the linker script to be used is located
/// * `stack_start` is the new, custom starting point from which our stack grows downwards –
/// this should be right *below* the `.bss+.data` region that we've moved to the top, e.g.:
/// ```
/// +-------------+
/// | .bss+.data |
Expand All @@ -32,7 +33,6 @@ pub fn link_normally(args: &[String]) -> io::Result<ExitStatus> {
/// | |
/// +-------------+
/// ```
/// * `custom_linker_script_location` is the directory in which the linker script to be used is located
pub fn link_modified(
args: &[String],
current_dir: &Path,
Expand Down
Loading

0 comments on commit 2635a67

Please sign in to comment.