Fix for jumptable naming in RELs
This commit is contained in:
parent
e9a9ed0453
commit
ccfbfd1a5a
|
@ -13,7 +13,11 @@ use serde_repr::{Deserialize_repr, Serialize_repr};
|
|||
use crate::{
|
||||
analysis::cfa::SectionAddress,
|
||||
obj::{ObjKind, ObjRelocKind},
|
||||
util::{config::is_auto_symbol, nested::NestedVec, split::is_linker_generated_label},
|
||||
util::{
|
||||
config::{is_auto_jump_table, is_auto_label, is_auto_symbol},
|
||||
nested::NestedVec,
|
||||
split::is_linker_generated_label,
|
||||
},
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||
|
@ -242,7 +246,11 @@ impl ObjSymbols {
|
|||
bail!("ABS symbol in relocatable object: {:?}", in_symbol);
|
||||
};
|
||||
let target_symbol_idx = if let Some((symbol_idx, existing)) = opt {
|
||||
let replace = replace || (is_auto_symbol(existing) && !is_auto_symbol(&in_symbol));
|
||||
let replace = replace
|
||||
// Replace auto symbols with known symbols
|
||||
|| (is_auto_symbol(existing) && !is_auto_symbol(&in_symbol))
|
||||
// Replace lbl_ with jumptable_
|
||||
|| (is_auto_label(existing) && is_auto_jump_table(&in_symbol));
|
||||
let size =
|
||||
if existing.size_known && in_symbol.size_known && existing.size != in_symbol.size {
|
||||
// TODO fix this and restore to warning
|
||||
|
|
|
@ -182,6 +182,10 @@ pub fn is_auto_symbol(symbol: &ObjSymbol) -> bool {
|
|||
|| symbol.name.starts_with("pad_")
|
||||
}
|
||||
|
||||
pub fn is_auto_label(symbol: &ObjSymbol) -> bool { symbol.name.starts_with("lbl_") }
|
||||
|
||||
pub fn is_auto_jump_table(symbol: &ObjSymbol) -> bool { symbol.name.starts_with("jumptable_") }
|
||||
|
||||
fn write_if_unchanged<P, Cb>(path: P, cb: Cb, cached_file: Option<FileReadInfo>) -> Result<()>
|
||||
where
|
||||
P: AsRef<Path>,
|
||||
|
|
Loading…
Reference in New Issue