feat(aya-obj)!: Rename BpfRelocationError -> EbpfRelocationError

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
pull/528/head
Dave Tucker 7 months ago
parent d7af6acb42
commit fd48c55466

@ -24,7 +24,7 @@ pub(crate) const INS_SIZE: usize = mem::size_of::<bpf_insn>();
/// The error type returned by [`Object::relocate_maps`] and [`Object::relocate_calls`]
#[derive(thiserror::Error, Debug)]
#[error("error relocating `{function}`")]
pub struct BpfRelocationError {
pub struct EbpfRelocationError {
/// The function name
function: String,
#[source]
@ -108,7 +108,7 @@ impl Object {
&mut self,
maps: I,
text_sections: &HashSet<usize>,
) -> Result<(), BpfRelocationError> {
) -> Result<(), EbpfRelocationError> {
let mut maps_by_section = HashMap::new();
let mut maps_by_symbol = HashMap::new();
for (name, fd, map) in maps {
@ -128,7 +128,7 @@ impl Object {
&self.symbol_table,
text_sections,
)
.map_err(|error| BpfRelocationError {
.map_err(|error| EbpfRelocationError {
function: function.name.clone(),
error,
})?;
@ -142,7 +142,7 @@ impl Object {
pub fn relocate_calls(
&mut self,
text_sections: &HashSet<usize>,
) -> Result<(), BpfRelocationError> {
) -> Result<(), EbpfRelocationError> {
for (name, program) in self.programs.iter() {
let linker = FunctionLinker::new(
&self.functions,
@ -154,7 +154,7 @@ impl Object {
let func_orig =
self.functions
.get(&program.function_key())
.ok_or_else(|| BpfRelocationError {
.ok_or_else(|| EbpfRelocationError {
function: name.clone(),
error: RelocationError::UnknownProgram {
section_index: program.section_index,
@ -162,7 +162,9 @@ impl Object {
},
})?;
let func = linker.link(func_orig).map_err(|error| BpfRelocationError {
let func = linker
.link(func_orig)
.map_err(|error| EbpfRelocationError {
function: name.to_owned(),
error,
})?;

@ -13,7 +13,7 @@ use std::{
use aya_obj::{
btf::{BtfFeatures, BtfRelocationError},
generated::{BPF_F_SLEEPABLE, BPF_F_XDP_HAS_FRAGS},
relocation::BpfRelocationError,
relocation::EbpfRelocationError,
EbpfSectionKind, Features,
};
use log::{debug, warn};
@ -1092,7 +1092,7 @@ pub enum BpfError {
/// Error performing relocations
#[error("error relocating function")]
RelocationError(#[from] BpfRelocationError),
RelocationError(#[from] EbpfRelocationError),
/// Error performing relocations
#[error("error relocating section")]

Loading…
Cancel
Save