-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start working on Partial linking support
- Loading branch information
1 parent
d195b11
commit 6aca2b2
Showing
5 changed files
with
101 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* SPDX-FileCopyrightText: © 2024 decompals */ | ||
/* SPDX-License-Identifier: MIT */ | ||
|
||
use crate::{LinkerWriter, Segment, Settings}; | ||
|
||
pub struct PartialLinkerWriter<'a> { | ||
main_writer: LinkerWriter<'a>, | ||
partial_writers: Vec<LinkerWriter<'a>>, | ||
|
||
settings: &'a Settings, | ||
} | ||
|
||
impl<'a> PartialLinkerWriter<'a> { | ||
pub fn new(settings: &'a Settings) -> Self { | ||
Self { | ||
main_writer: LinkerWriter::new(settings), | ||
partial_writers: Vec::new(), | ||
|
||
settings, | ||
} | ||
} | ||
|
||
pub fn add_segment(&mut self, _segment: &Segment) { | ||
let partial_writer = LinkerWriter::new(self.settings); | ||
|
||
self.partial_writers.push(partial_writer); | ||
} | ||
} | ||
|
||
// Getters / Setters | ||
impl PartialLinkerWriter<'_> { | ||
#[must_use] | ||
pub fn get_main_writer(&self) -> &LinkerWriter { | ||
&self.main_writer | ||
} | ||
|
||
#[must_use] | ||
pub fn get_partial_writers(&self) -> &Vec<LinkerWriter> { | ||
&self.partial_writers | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters