Fix missing common BSS symbols

Resolves #128
This commit is contained in:
2024-10-28 17:54:49 -06:00
parent 2cf9cf24d6
commit d2b7a9ef25
5 changed files with 19 additions and 15 deletions

View File

@@ -164,9 +164,11 @@ pub struct SymbolRef {
pub symbol_idx: usize,
}
pub const SECTION_COMMON: usize = usize::MAX - 1;
impl ObjInfo {
pub fn section_symbol(&self, symbol_ref: SymbolRef) -> (Option<&ObjSection>, &ObjSymbol) {
if symbol_ref.section_idx == self.sections.len() {
if symbol_ref.section_idx == SECTION_COMMON {
let symbol = &self.common[symbol_ref.symbol_idx];
return (None, symbol);
}