dol apply: Don't apply gap symbols
Also don't overwrite "unknown" scope with global. Fixes #30
This commit is contained in:
parent
26cc6a13b4
commit
4a84975648
|
@ -1654,6 +1654,9 @@ fn apply(args: ApplyArgs) -> Result<()> {
|
|||
if linked_scope != ObjSymbolScope::Unknown
|
||||
&& !is_globalized
|
||||
&& linked_scope != orig_sym.flags.scope()
|
||||
// Don't overwrite unknown scope with global
|
||||
&& (linked_scope != ObjSymbolScope::Global
|
||||
|| orig_sym.flags.scope() != ObjSymbolScope::Unknown)
|
||||
{
|
||||
log::info!(
|
||||
"Changing scope of {} (type {:?}) from {:?} to {:?}",
|
||||
|
@ -1683,6 +1686,7 @@ fn apply(args: ApplyArgs) -> Result<()> {
|
|||
// Add symbols from the linked object that aren't in the original
|
||||
for linked_sym in linked_obj.symbols.iter() {
|
||||
if matches!(linked_sym.kind, ObjSymbolKind::Section)
|
||||
|| is_auto_symbol(linked_sym)
|
||||
|| is_linker_generated_object(&linked_sym.name)
|
||||
// skip ABS for now
|
||||
|| linked_sym.section.is_none()
|
||||
|
|
|
@ -178,6 +178,8 @@ pub fn is_auto_symbol(symbol: &ObjSymbol) -> bool {
|
|||
symbol.name.starts_with("lbl_")
|
||||
|| symbol.name.starts_with("fn_")
|
||||
|| symbol.name.starts_with("jumptable_")
|
||||
|| symbol.name.starts_with("gap_")
|
||||
|| symbol.name.starts_with("pad_")
|
||||
}
|
||||
|
||||
fn write_if_unchanged<P, Cb>(path: P, cb: Cb, cached_file: Option<FileReadInfo>) -> Result<()>
|
||||
|
|
Loading…
Reference in New Issue