Add data info for superh (#198)

* Add data info for superh

* fmt

* Fetch symbol data dynamically from resolved.section

* Remove unused var

---------

Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
sozud
2025-05-06 21:30:53 -07:00
committed by GitHub
parent a1499f475d
commit 1d782243e0
2 changed files with 153 additions and 1 deletions

View File

@@ -109,6 +109,11 @@ impl Section {
}
}
pub fn symbol_data(&self, symbol: &Symbol) -> Option<&[u8]> {
let offset = symbol.address.checked_sub(self.address)?;
self.data.get(offset as usize..offset as usize + symbol.size as usize)
}
// The alignment to use when "Combine data/text sections" is enabled.
pub fn combined_alignment(&self) -> u64 {
const MIN_ALIGNMENT: u64 = 4;