1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-12 12:29:32 +00:00

Merge pull request #1672 from spiro-trikaliotis/pr-1647

ca65: .constructor after .export fails
This commit is contained in:
Bob Andrews 2022-02-15 22:34:04 +01:00 committed by GitHub
commit bfa9e77523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -546,6 +546,18 @@ void SymConDes (SymEntry* S, unsigned char AddrSize, unsigned Type, unsigned Pri
return;
}
/* If the symbol is already defined, check symbol size against the
** exported size.
*/
if (S->Flags & SF_DEFINED) {
if (AddrSize == ADDR_SIZE_DEFAULT) {
/* Use the real size of the symbol */
AddrSize = S->AddrSize;
} else if (S->AddrSize != AddrSize) {
Error ("Address size mismatch for symbol '%m%p'", GetSymName (S));
}
}
/* If the symbol was already marked as an export or global, check if
** this was done specifiying the same address size. In case of a global
** declaration, silently remove the global flag.
@ -558,18 +570,6 @@ void SymConDes (SymEntry* S, unsigned char AddrSize, unsigned Type, unsigned Pri
}
S->ExportSize = AddrSize;
/* If the symbol is already defined, check symbol size against the
** exported size.
*/
if (S->Flags & SF_DEFINED) {
if (S->ExportSize == ADDR_SIZE_DEFAULT) {
/* Use the real size of the symbol */
S->ExportSize = S->AddrSize;
} else if (S->AddrSize != S->ExportSize) {
Error ("Address size mismatch for symbol '%m%p'", GetSymName (S));
}
}
/* If the symbol already was declared as a condes of this type,
** check if the new priority value is the same as the old one.
*/