don't add our symbols to the eh_frame section; it's not needed

This commit is contained in:
Folkert 2022-08-21 20:41:31 +02:00
parent 5261005096
commit 4e9bff9eb6
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -475,20 +475,6 @@ fn copy_file(in_data: &[u8], custom_names: &[String]) -> Result<Vec<u8>, Box<dyn
}
}
let custom_symbols: Vec<_> = custom_names
.iter()
.map(|name| {
// .eh_frame
let section = out_sections_index[5];
out_syms_index.push(writer.reserve_symbol_index(Some(section)));
let name = writer.add_string(name.as_bytes());
(name, section)
})
.collect();
// Start reserving file ranges.
writer.reserve_file_header();
@ -666,19 +652,6 @@ fn copy_file(in_data: &[u8], custom_names: &[String]) -> Result<Vec<u8>, Box<dyn
});
}
// DEVIATION
for (name, section) in custom_symbols {
writer.write_symbol(&object::write::elf::Sym {
name: Some(name),
section: Some(section),
st_info: (elf::STB_WEAK << 4) | elf::STT_FUNC,
st_other: 0,
st_shndx: 3,
st_value: 0x1000,
st_size: 0,
});
}
writer.write_symtab_shndx();
writer.write_strtab();