fixup symbol export

This commit is contained in:
Michael Sippel 2024-10-21 00:20:55 +02:00
parent 489d9886e3
commit 45869fdd30
Signed by: senvas
GPG key ID: F96CF119C34B64A6
4 changed files with 69 additions and 19 deletions
ltcc/src

View file

@ -53,6 +53,18 @@ fn main() {
.export()
.into_iter()
.filter_map(|(symbol, def)| match def {
ltcore::symbols::SymbolDef::StaticRef { typ, link_addr, export } => {
eprintln!("runtime export static REF {}", export);
if export {
if let Some(addr)= link_addr {
Some((symbol, addr))
} else {
Some((symbol.clone(), runtime_linker.get_link_addr(&symbol).unwrap_or(-1)))
}
} else {
None
}
}
ltcore::symbols::SymbolDef::Procedure { in_types:_, out_types:_, link_addr, export } => {
if true {
match link_addr {
@ -198,6 +210,17 @@ fn main() {
.export()
.into_iter()
.filter_map(|(symbol, def)| match def {
ltcore::symbols::SymbolDef::StaticRef { typ, link_addr, export } => {
if export {
if let Some(addr)= link_addr {
Some((symbol.clone(), addr))
} else {
Some((symbol.clone(), linker.get_link_addr(&symbol).unwrap_or(-1)))
}
} else {
None
}
}
ltcore::symbols::SymbolDef::Procedure { in_types:_, out_types:_, link_addr, export } => {
if export {
match link_addr {