mirror of
https://github.com/encounter/decomp-toolkit.git
synced 2025-12-12 06:45:09 +00:00
Don't use map in dol diff and dol apply; remove common BSS hack
This commit is contained in:
@@ -115,9 +115,6 @@ pub struct DiffArgs {
|
||||
#[argp(positional)]
|
||||
/// linked ELF
|
||||
elf_file: PathBuf,
|
||||
#[argp(positional)]
|
||||
/// map file
|
||||
map_file: PathBuf,
|
||||
}
|
||||
|
||||
#[derive(FromArgs, PartialEq, Eq, Debug)]
|
||||
@@ -130,9 +127,6 @@ pub struct ApplyArgs {
|
||||
#[argp(positional)]
|
||||
/// linked ELF
|
||||
elf_file: PathBuf,
|
||||
#[argp(positional)]
|
||||
/// map file
|
||||
map_file: PathBuf,
|
||||
}
|
||||
|
||||
#[derive(FromArgs, PartialEq, Eq, Debug)]
|
||||
@@ -1226,9 +1220,6 @@ fn diff(args: DiffArgs) -> Result<()> {
|
||||
log::info!("Loading {}", args.elf_file.display());
|
||||
let mut linked_obj = process_elf(&args.elf_file)?;
|
||||
|
||||
log::info!("Loading {}", args.map_file.display());
|
||||
apply_map_file(&args.map_file, &mut linked_obj)?;
|
||||
|
||||
for orig_sym in obj
|
||||
.symbols
|
||||
.iter()
|
||||
@@ -1380,9 +1371,6 @@ fn apply(args: ApplyArgs) -> Result<()> {
|
||||
log::info!("Loading {}", args.elf_file.display());
|
||||
let mut linked_obj = process_elf(&args.elf_file)?;
|
||||
|
||||
log::info!("Loading {}", args.map_file.display());
|
||||
apply_map_file(&args.map_file, &mut linked_obj)?;
|
||||
|
||||
let mut replacements: Vec<(SymbolIndex, Option<ObjSymbol>)> = vec![];
|
||||
for (orig_idx, orig_sym) in obj.symbols.iter().enumerate() {
|
||||
// skip ABS for now
|
||||
|
||||
@@ -890,7 +890,6 @@ pub fn split_obj(obj: &ObjInfo) -> Result<Vec<ObjInfo>> {
|
||||
|
||||
// Add section symbols
|
||||
let out_section_idx = file.sections.next_section_index();
|
||||
let mut comm_addr = current_address;
|
||||
for (symbol_idx, symbol) in obj
|
||||
.symbols
|
||||
.for_section_range(section_index, current_address.address..=file_end.address)
|
||||
@@ -911,23 +910,6 @@ pub fn split_obj(obj: &ObjInfo) -> Result<Vec<ObjInfo>> {
|
||||
continue;
|
||||
}
|
||||
|
||||
if split.common && symbol.address as u32 > comm_addr.address {
|
||||
// HACK: Add padding for common bug
|
||||
file.symbols.add_direct(ObjSymbol {
|
||||
name: format!("pad_{:010X}", comm_addr),
|
||||
demangled_name: None,
|
||||
address: 0,
|
||||
section: None,
|
||||
size: symbol.address - comm_addr.address as u64,
|
||||
size_known: true,
|
||||
flags: ObjSymbolFlagSet(ObjSymbolFlags::Common.into()),
|
||||
kind: ObjSymbolKind::Object,
|
||||
align: Some(4),
|
||||
data_kind: Default::default(),
|
||||
})?;
|
||||
}
|
||||
comm_addr.address = (symbol.address + symbol.size) as u32;
|
||||
|
||||
symbol_idxs[symbol_idx] = Some(file.symbols.add_direct(ObjSymbol {
|
||||
name: symbol.name.clone(),
|
||||
demangled_name: symbol.demangled_name.clone(),
|
||||
|
||||
Reference in New Issue
Block a user