Mark the symbol that is the name of a scope with the size of that scope

(previously only the scope itself had that size).
Pass the size of symbols through the object file to the linker. Bump the
object file version and adjust object file reading tools (od65, ar65) to this
change.
Read the size in the linker and output it in the debug info.
Bump the minor version number of the debug info. Read the size and allow to
access it via the API. Do better version checking for the debug info and try
to be smarter when encountering unknown keywords to improve support for newer
minor versions.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5057 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-06-13 18:43:50 +00:00
parent 7c2104c3cb
commit 795d9e1a1c
22 changed files with 349 additions and 170 deletions

View File

@@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 2003-2008, Ullrich von Bassewit */
/* (C) 2003-2011, Ullrich von Bassewit */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
@@ -44,7 +44,7 @@
/*****************************************************************************/
/* Data */
/* Data */
/*****************************************************************************/
@@ -52,7 +52,7 @@
/* The name of the symbol used to encode the size. The name of this entry is
* choosen so that it cannot be accessed by the user.
*/
const StrBuf SizeEntryName = LIT_STRBUF_INITIALIZER (".size");
static const StrBuf SizeEntryName = LIT_STRBUF_INITIALIZER (".size");
@@ -62,6 +62,36 @@ const StrBuf SizeEntryName = LIT_STRBUF_INITIALIZER (".size");
int IsSizeOfSymbol (const SymEntry* Sym)
/* Return true if the given symbol is the one that encodes the size of some
* entity. Sym may also be a NULL pointer in which case false is returned.
*/
{
return (Sym != 0 && SB_Compare (GetSymName (Sym), &SizeEntryName) == 0);
}
SymEntry* FindSizeOfScope (SymTable* Scope)
/* Get the size of a scope. The function returns the symbol table entry that
* encodes the size or NULL if there is no such entry.
*/
{
return SymFind (Scope, &SizeEntryName, SYM_FIND_EXISTING);
}
SymEntry* FindSizeOfSymbol (SymEntry* Sym)
/* Get the size of a symbol table entry. The function returns the symbol table
* entry that encodes the size of the symbol or NULL if there is no such entry.
*/
{
return SymFindLocal (Sym, &SizeEntryName, SYM_FIND_EXISTING);
}
SymEntry* GetSizeOfScope (SymTable* Scope)
/* Get the size of a scope. The function returns the symbol table entry that
* encodes the size, and will create a new entry if it does not exist.