1
Fork 0

naming cleanup

This commit is contained in:
Jan-Erik Rediger 2023-12-08 23:27:18 +01:00
parent 4bcf581a46
commit d768d62b4e
2 changed files with 21 additions and 8 deletions

View file

@ -80,7 +80,7 @@ impl Symbol {
} }
#[getter] #[getter]
fn global(&self) -> bool { fn is_global(&self) -> bool {
self.meta.is_global() self.meta.is_global()
} }
@ -109,7 +109,7 @@ impl Symbol {
"Symbol {{ name: {}, type: {}, global: {}, weak: {}, undefined: {}, stab: {}, meta: {:?} }}", "Symbol {{ name: {}, type: {}, global: {}, weak: {}, undefined: {}, stab: {}, meta: {:?} }}",
self.name, self.name,
self.typ(), self.typ(),
self.global(), self.is_global(),
self.weak(), self.weak(),
self.undefined(), self.undefined(),
self.stab(), self.stab(),

View file

@ -5,10 +5,23 @@ print(g.header)
print(g.name) print(g.name)
print("symbols") print("symbols")
globsym = None
start = -1
end = 9999999999
for sym in g.symbols(): for sym in g.symbols():
if not sym.undefined: if "META" in sym.name and sym.is_global:
print(sym) if globsym is None:
break globsym = sym
start = sym.meta.n_value
for sym in g.symbols():
if sym.meta.n_value > start and sym.meta.n_value < end:
print(f"sym after the found one: {sym}")
end = sym.meta.n_value
print(f"found symbol {globsym.name} from {start} to {end}, size: {end-start}")
print(globsym)
print("libs") print("libs")
print(g.libs) print(g.libs)
@ -23,6 +36,6 @@ print("imports")
print(len(g.imports())) print(len(g.imports()))
print("sections") print("sections")
sections = iter(g.sections())
print(next(sections)) for idx, section in enumerate(g.sections()):
print(next(sections)) print(f"{idx+1}. {section}")