Allow local symbols to be referenced

Local symbols can now be referenced outside the scope of their parent, by using the syntax “Parent.Chlid”.

- Local symbol names are now stored internally as “Parent.Child”.
- The symbol’s scope field no longer forms a linked list of the prior local symbols; it will now always contain the parent.
- Add the ability use EXPORT and GLOBAL with local symbols.
- Reduce duplication between findsymbol() and findpsymbol(), as well as between sym_AddLocalReloc() and sym_AddReloc().
This commit is contained in:
Ben10do
2017-06-12 19:12:24 +01:00
parent ff2321a8ce
commit ce8a13a562
4 changed files with 78 additions and 56 deletions

View File

@@ -587,7 +587,11 @@ label : /* empty */
else
sym_AddReloc($1);
} | T_LABEL ':' ':' {
sym_AddReloc($1);
if ($1[0] == '.') {
sym_AddLocalReloc($1);
} else {
sym_AddReloc($1);
}
sym_Export($1);
};