struct EhFrameWriter {
relocs: Vec<EhRelocation>,
writer: EndianVec<RunTimeEndian>,
}Expand description
A gimli [Writer] for the .eh_frame section that records the relocations
required against the function symbol, the personality routine and the LSDA.
This mirrors [wasmer_compiler::dwarf::WriterRelocate], but implements the
Writer trait of the gimli version re-exported by cranelift-codegen
(which differs from the workspace gimli version), so that Cranelift’s
FrameTable/FrameDescriptionEntry types can be serialized with it. The
recorded relocations use the shared [EhRelocation] representation.
Fields§
§relocs: Vec<EhRelocation>§writer: EndianVec<RunTimeEndian>Implementations§
Source§impl EhFrameWriter
impl EhFrameWriter
fn new() -> Self
fn into_bytes(self) -> Vec<u8> ⓘ
fn target_for(symbol: usize) -> GimliResult<EhTarget>
Trait Implementations§
Source§impl Writer for EhFrameWriter
Available on crate feature unwind only.
impl Writer for EhFrameWriter
Available on crate feature
unwind only.Source§fn write_at(&mut self, offset: usize, bytes: &[u8]) -> GimliResult<()>
fn write_at(&mut self, offset: usize, bytes: &[u8]) -> GimliResult<()>
Write a slice at a given offset. Read more
Source§fn write_address(&mut self, address: Address, size: u8) -> GimliResult<()>
fn write_address(&mut self, address: Address, size: u8) -> GimliResult<()>
Write an address. Read more
Source§fn write_eh_pointer(
&mut self,
address: Address,
eh_pe: DwEhPe,
size: u8,
) -> GimliResult<()>
fn write_eh_pointer( &mut self, address: Address, eh_pe: DwEhPe, size: u8, ) -> GimliResult<()>
Write an address with a
.eh_frame pointer encoding. Read moreSource§fn write_offset(
&mut self,
_val: usize,
_section: GimliSectionId,
_size: u8,
) -> GimliResult<()>
fn write_offset( &mut self, _val: usize, _section: GimliSectionId, _size: u8, ) -> GimliResult<()>
Write an offset that is relative to the start of the given section. Read more
Source§fn write_offset_at(
&mut self,
_offset: usize,
_val: usize,
_section: GimliSectionId,
_size: u8,
) -> GimliResult<()>
fn write_offset_at( &mut self, _offset: usize, _val: usize, _section: GimliSectionId, _size: u8, ) -> GimliResult<()>
Write an offset that is relative to the start of the given section. Read more
§fn write_eh_pointer_data(
&mut self,
val: u64,
format: DwEhPe,
size: u8,
) -> Result<(), Error>
fn write_eh_pointer_data( &mut self, val: u64, format: DwEhPe, size: u8, ) -> Result<(), Error>
Write a value with a
.eh_frame pointer format. Read more§fn write_reference(&mut self, _symbol: usize, _size: u8) -> Result<(), Error>
fn write_reference(&mut self, _symbol: usize, _size: u8) -> Result<(), Error>
Write a reference to a symbol. Read more
§fn write_u128(&mut self, val: u128) -> Result<(), Error>
fn write_u128(&mut self, val: u128) -> Result<(), Error>
Write a u128.
§fn write_u8_at(&mut self, offset: usize, val: u8) -> Result<(), Error>
fn write_u8_at(&mut self, offset: usize, val: u8) -> Result<(), Error>
Write a u8 at the given offset.
§fn write_u16_at(&mut self, offset: usize, val: u16) -> Result<(), Error>
fn write_u16_at(&mut self, offset: usize, val: u16) -> Result<(), Error>
Write a u16 at the given offset.
§fn write_u32_at(&mut self, offset: usize, val: u32) -> Result<(), Error>
fn write_u32_at(&mut self, offset: usize, val: u32) -> Result<(), Error>
Write a u32 at the given offset.
§fn write_u64_at(&mut self, offset: usize, val: u64) -> Result<(), Error>
fn write_u64_at(&mut self, offset: usize, val: u64) -> Result<(), Error>
Write a u64 at the given offset.
§fn write_u128_at(&mut self, offset: usize, val: u128) -> Result<(), Error>
fn write_u128_at(&mut self, offset: usize, val: u128) -> Result<(), Error>
Write a u128 at the given offset.
§fn write_udata(&mut self, val: u64, size: u8) -> Result<(), Error>
fn write_udata(&mut self, val: u64, size: u8) -> Result<(), Error>
Write unsigned data of the given size. Read more
§fn write_sdata(&mut self, val: i64, size: u8) -> Result<(), Error>
fn write_sdata(&mut self, val: i64, size: u8) -> Result<(), Error>
Write signed data of the given size. Read more
§fn write_udata_at(
&mut self,
offset: usize,
val: u64,
size: u8,
) -> Result<(), Error>
fn write_udata_at( &mut self, offset: usize, val: u64, size: u8, ) -> Result<(), Error>
Write a word of the given size at the given offset. Read more
§fn write_uleb128(&mut self, val: u64) -> Result<(), Error>
fn write_uleb128(&mut self, val: u64) -> Result<(), Error>
Write an unsigned LEB128 encoded integer.
§fn write_sleb128(&mut self, val: i64) -> Result<(), Error>
fn write_sleb128(&mut self, val: i64) -> Result<(), Error>
Write a signed LEB128 encoded integer.
§fn write_initial_length(
&mut self,
format: Format,
) -> Result<InitialLengthOffset, Error>
fn write_initial_length( &mut self, format: Format, ) -> Result<InitialLengthOffset, Error>
Write an initial length according to the given DWARF format. Read more
Auto Trait Implementations§
impl Freeze for EhFrameWriter
impl RefUnwindSafe for EhFrameWriter
impl Send for EhFrameWriter
impl Sync for EhFrameWriter
impl Unpin for EhFrameWriter
impl UnsafeUnpin for EhFrameWriter
impl UnwindSafe for EhFrameWriter
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Pointee for T
impl<T> Pointee for T
§impl<T> Upcastable for T
impl<T> Upcastable for T
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref
§fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
upcast boxed dyn