mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 05:49:23 +02:00
Change mangling to avoid overlap and increase PPU version
git-svn-id: trunk@18946 -
This commit is contained in:
parent
80c8cdcf78
commit
4c633c46ed
@ -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;
|
||||||
|
@ -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 }
|
||||||
|
Loading…
Reference in New Issue
Block a user