pub struct OutputSection { /* private fields */ }Expand description
One laid-out section in a linked Image: a name, the address it begins at, and its
merged, relocated bytes.
An output section is the concatenation of every input section that shared its name,
in object order, placed at a fixed address. Its
data is final — relocations into it have been patched — so it
is ready to be written to a file or loaded into memory at that address.
§Examples
use linker_lang::{link, Object};
let mut obj = Object::new("o");
obj.section(".text", [1, 2, 3, 4]);
let image = link(&[obj]).unwrap();
let text = image.section(".text").unwrap();
assert_eq!(text.name(), ".text");
assert_eq!(text.address(), 0);
assert_eq!(text.data(), &[1, 2, 3, 4]);Implementations§
Trait Implementations§
Source§impl Clone for OutputSection
impl Clone for OutputSection
Source§fn clone(&self) -> OutputSection
fn clone(&self) -> OutputSection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OutputSection
impl Debug for OutputSection
Source§impl<'de> Deserialize<'de> for OutputSection
impl<'de> Deserialize<'de> for OutputSection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for OutputSection
Source§impl PartialEq for OutputSection
impl PartialEq for OutputSection
Source§fn eq(&self, other: &OutputSection) -> bool
fn eq(&self, other: &OutputSection) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for OutputSection
impl Serialize for OutputSection
impl StructuralPartialEq for OutputSection
Auto Trait Implementations§
impl Freeze for OutputSection
impl RefUnwindSafe for OutputSection
impl Send for OutputSection
impl Sync for OutputSection
impl Unpin for OutputSection
impl UnsafeUnpin for OutputSection
impl UnwindSafe for OutputSection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more