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]
fn global(&self) -> bool {
fn is_global(&self) -> bool {
self.meta.is_global()
}
@ -109,7 +109,7 @@ impl Symbol {
"Symbol {{ name: {}, type: {}, global: {}, weak: {}, undefined: {}, stab: {}, meta: {:?} }}",
self.name,
self.typ(),
self.global(),
self.is_global(),
self.weak(),
self.undefined(),
self.stab(),

View file

@ -5,10 +5,23 @@ print(g.header)
print(g.name)
print("symbols")
globsym = None
start = -1
end = 9999999999
for sym in g.symbols():
if not sym.undefined:
print(sym)
break
if "META" in sym.name and sym.is_global:
if globsym is None:
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(g.libs)
@ -23,6 +36,6 @@ print("imports")
print(len(g.imports()))
print("sections")
sections = iter(g.sections())
print(next(sections))
print(next(sections))
for idx, section in enumerate(g.sections()):
print(f"{idx+1}. {section}")