Change mangling to avoid overlap and increase PPU version

git-svn-id: trunk@18946 -
This commit is contained in:
pierre 2011-09-02 14:20:14 +00:00
parent 80c8cdcf78
commit 4c633c46ed
2 changed files with 15 additions and 4 deletions

View File

@ -43,7 +43,7 @@ type
{$endif Test_Double_checksum} {$endif Test_Double_checksum}
const const
CurrentPPUVersion = 136; CurrentPPUVersion = 137;
{ buffer sizes } { buffer sizes }
maxentrysize = 1024; maxentrysize = 1024;

View File

@ -917,9 +917,20 @@ implementation
{ symtable must now be static or global } { symtable must now be static or global }
if not(st.symtabletype in [staticsymtable,globalsymtable]) then if not(st.symtabletype in [staticsymtable,globalsymtable]) then
internalerror(200204175); internalerror(200204175);
{ The mangled name is made out of at most 4 parts:
1) Optional typeprefix given as first parameter
with '_$' appended if not empty
2) Unit name or 'P$'+program name (never empty)
3) optional prefix variable that contains a unique
name for the local symbol table (prepended with '$_$'
if not empty)
4) suffix as given as third parameter,
also optional (i.e. can be empty)
prepended by '_$$_' if not empty }
result:=''; result:='';
if typeprefix<>'' then if typeprefix<>'' then
result:=result+typeprefix+'_'; result:=result+typeprefix+'_$';
{ Add P$ for program, which can have the same name as { Add P$ for program, which can have the same name as
a unit } a unit }
if (TSymtable(main_module.localsymtable)=st) and if (TSymtable(main_module.localsymtable)=st) and
@ -928,9 +939,9 @@ implementation
else else
result:=result+st.name^; result:=result+st.name^;
if prefix<>'' then if prefix<>'' then
result:=result+'_'+prefix; result:=result+'$_$'+prefix;
if suffix<>'' then if suffix<>'' then
result:=result+'_$'+suffix; result:=result+'_$$_'+suffix;
{ the Darwin assembler assumes that all symbols starting with 'L' are local } { the Darwin assembler assumes that all symbols starting with 'L' are local }
{ Further, the Mac OS X 10.5 linker does not consider symbols which do not } { Further, the Mac OS X 10.5 linker does not consider symbols which do not }
{ start with '_' as regular symbols (it does not generate N_GSYM entries } { start with '_' as regular symbols (it does not generate N_GSYM entries }