mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-05 16:26:14 +02:00
* Fixes and further development of fast threadvars
git-svn-id: trunk@743 -
This commit is contained in:
parent
4996b31df1
commit
e98865ab40
@ -47,7 +47,7 @@ interface
|
|||||||
TAsmRelocationType = (RELOC_ABSOLUTE,RELOC_RELATIVE,RELOC_RVA);
|
TAsmRelocationType = (RELOC_ABSOLUTE,RELOC_RELATIVE,RELOC_RVA);
|
||||||
|
|
||||||
TAsmSectionType=(sec_none,
|
TAsmSectionType=(sec_none,
|
||||||
sec_code,sec_data,sec_rodata,sec_bss,sec_tbss,
|
sec_code,sec_data,sec_rodata,sec_bss,sec_threadvar,
|
||||||
sec_common, { used for executable creation }
|
sec_common, { used for executable creation }
|
||||||
sec_custom, { custom section, no prefix }
|
sec_custom, { custom section, no prefix }
|
||||||
{ stabs }
|
{ stabs }
|
||||||
@ -572,7 +572,7 @@ implementation
|
|||||||
function TAsmObjectData.sectionname(atype:tasmsectiontype;const aname:string):string;
|
function TAsmObjectData.sectionname(atype:tasmsectiontype;const aname:string):string;
|
||||||
const
|
const
|
||||||
secnames : array[tasmsectiontype] of string[12] = ('',
|
secnames : array[tasmsectiontype] of string[12] = ('',
|
||||||
'code','data','rodata','bss','tbss',
|
'code','data','rodata','bss','threadvar',
|
||||||
'common',
|
'common',
|
||||||
'note',
|
'note',
|
||||||
'stab','stabstr',
|
'stab','stabstr',
|
||||||
|
@ -281,7 +281,7 @@ var
|
|||||||
const
|
const
|
||||||
secnames : array[tasmsectiontype] of string[12] = ('',
|
secnames : array[tasmsectiontype] of string[12] = ('',
|
||||||
{$warning TODO .rodata not yet working}
|
{$warning TODO .rodata not yet working}
|
||||||
'.text','.data','.data','.bss','.tbss',
|
'.text','.data','.data','.bss','.threadvar',
|
||||||
'common',
|
'common',
|
||||||
'.note',
|
'.note',
|
||||||
'.stab','.stabstr',
|
'.stab','.stabstr',
|
||||||
@ -291,7 +291,7 @@ var
|
|||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
if use_smartlink_section and
|
if use_smartlink_section and
|
||||||
not (atype in [sec_bss,sec_tbss]) and
|
not (atype in [sec_bss,sec_threadvar]) and
|
||||||
(aname<>'') then
|
(aname<>'') then
|
||||||
result:='.gnu.linkonce'+copy(secnames[atype],1,2)+'.'+aname
|
result:='.gnu.linkonce'+copy(secnames[atype],1,2)+'.'+aname
|
||||||
else
|
else
|
||||||
|
@ -1085,7 +1085,7 @@ Implementation
|
|||||||
end;
|
end;
|
||||||
ait_datablock :
|
ait_datablock :
|
||||||
begin
|
begin
|
||||||
if not (objectdata.currsec.sectype in [sec_bss,sec_tbss]) then
|
if not (objectdata.currsec.sectype in [sec_bss,sec_threadvar]) then
|
||||||
Message(asmw_e_alloc_data_only_in_bss);
|
Message(asmw_e_alloc_data_only_in_bss);
|
||||||
l:=used_align(size_2_align(Tai_datablock(hp).size),0,objectdata.currsec.addralign);
|
l:=used_align(size_2_align(Tai_datablock(hp).size),0,objectdata.currsec.addralign);
|
||||||
if Tai_datablock(hp).is_global and
|
if Tai_datablock(hp).is_global and
|
||||||
@ -1256,7 +1256,7 @@ Implementation
|
|||||||
case hp.typ of
|
case hp.typ of
|
||||||
ait_align :
|
ait_align :
|
||||||
begin
|
begin
|
||||||
if objectdata.currsec.sectype in [sec_bss,sec_tbss] then
|
if objectdata.currsec.sectype in [sec_bss,sec_threadvar] then
|
||||||
objectdata.alloc(Tai_align(hp).fillsize)
|
objectdata.alloc(Tai_align(hp).fillsize)
|
||||||
else
|
else
|
||||||
objectdata.writebytes(Tai_align(hp).calculatefillbuf(fillbuffer)^,Tai_align(hp).fillsize);
|
objectdata.writebytes(Tai_align(hp).calculatefillbuf(fillbuffer)^,Tai_align(hp).fillsize);
|
||||||
|
@ -1981,7 +1981,7 @@ implementation
|
|||||||
if (vo_is_thread_var in sym.varoptions) then
|
if (vo_is_thread_var in sym.varoptions) then
|
||||||
begin
|
begin
|
||||||
list:=asmlist[threadvarsegment];
|
list:=asmlist[threadvarsegment];
|
||||||
sectype:=sec_tbss;
|
sectype:=sec_threadvar;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
@ -554,7 +554,7 @@ const go32v2stub : array[0..2047] of byte=(
|
|||||||
function TCoffObjectData.sectionname(atype:tasmsectiontype;const aname:string):string;
|
function TCoffObjectData.sectionname(atype:tasmsectiontype;const aname:string):string;
|
||||||
const
|
const
|
||||||
secnames : array[tasmsectiontype] of string[16] = ('',
|
secnames : array[tasmsectiontype] of string[16] = ('',
|
||||||
'.text','.data','.data','.bss','.tbss',
|
'.text','.data','.data','.bss','.threadvar',
|
||||||
'common',
|
'common',
|
||||||
'.note',
|
'.note',
|
||||||
'.stab','.stabstr',
|
'.stab','.stabstr',
|
||||||
|
@ -236,7 +236,7 @@ implementation
|
|||||||
AshType:=SHT_PROGBITS;
|
AshType:=SHT_PROGBITS;
|
||||||
AAlign:=max(sizeof(aint),AAlign);
|
AAlign:=max(sizeof(aint),AAlign);
|
||||||
end;
|
end;
|
||||||
sec_bss,sec_tbss :
|
sec_bss,sec_threadvar :
|
||||||
begin
|
begin
|
||||||
Ashflags:=SHF_ALLOC or SHF_WRITE;
|
Ashflags:=SHF_ALLOC or SHF_WRITE;
|
||||||
AshType:=SHT_NOBITS;
|
AshType:=SHT_NOBITS;
|
||||||
@ -308,7 +308,9 @@ implementation
|
|||||||
createsection(sec_code,'',0,[]);
|
createsection(sec_code,'',0,[]);
|
||||||
createsection(sec_data,'',0,[]);
|
createsection(sec_data,'',0,[]);
|
||||||
createsection(sec_bss,'',0,[]);
|
createsection(sec_bss,'',0,[]);
|
||||||
createsection(sec_tbss,'',0,[]);
|
{$ifdef segment_threadvars}
|
||||||
|
createsection(sec_threadvar,'',0,[]);
|
||||||
|
{$endif}
|
||||||
{ create stabs sections if debugging }
|
{ create stabs sections if debugging }
|
||||||
if (cs_debuginfo in aktmoduleswitches) then
|
if (cs_debuginfo in aktmoduleswitches) then
|
||||||
begin
|
begin
|
||||||
@ -332,9 +334,9 @@ implementation
|
|||||||
const
|
const
|
||||||
secnames : array[tasmsectiontype] of string[12] = ('',
|
secnames : array[tasmsectiontype] of string[12] = ('',
|
||||||
{$ifdef userodata}
|
{$ifdef userodata}
|
||||||
'.text','.data','.rodata','.bss','.tbss',
|
'.text','.data','.rodata','.bss','.threadvar',
|
||||||
{$else userodata}
|
{$else userodata}
|
||||||
'.text','.data','.data','.bss','.tbss',
|
'.text','.data','.data','.bss','.threadvar',
|
||||||
{$endif userodata}
|
{$endif userodata}
|
||||||
'common',
|
'common',
|
||||||
'.note',
|
'.note',
|
||||||
@ -345,7 +347,7 @@ implementation
|
|||||||
);
|
);
|
||||||
begin
|
begin
|
||||||
if use_smartlink_section and
|
if use_smartlink_section and
|
||||||
not (atype in [sec_bss,sec_tbss]) and
|
not (atype in [sec_bss,sec_threadvar]) and
|
||||||
(aname<>'') then
|
(aname<>'') then
|
||||||
result:='.gnu.linkonce'+copy(secnames[atype],1,2)+'.'+aname
|
result:='.gnu.linkonce'+copy(secnames[atype],1,2)+'.'+aname
|
||||||
else
|
else
|
||||||
@ -379,7 +381,7 @@ implementation
|
|||||||
if currsec=nil then
|
if currsec=nil then
|
||||||
internalerror(200403292);
|
internalerror(200403292);
|
||||||
{$ifdef userodata}
|
{$ifdef userodata}
|
||||||
if currsec.sectype in [sec_rodata,sec_bss,sec_tbss] then
|
if currsec.sectype in [sec_rodata,sec_bss,sec_threadvar] then
|
||||||
internalerror(200408252);
|
internalerror(200408252);
|
||||||
{$endif userodata}
|
{$endif userodata}
|
||||||
if assigned(p) then
|
if assigned(p) then
|
||||||
|
@ -76,7 +76,7 @@ interface
|
|||||||
'csect', {code}
|
'csect', {code}
|
||||||
'csect', {data}
|
'csect', {data}
|
||||||
'csect', {read only data}
|
'csect', {read only data}
|
||||||
'csect', {bss}, 'csect',
|
'csect', {bss} 'csect',
|
||||||
'csect','csect','csect','csect','','','','','','','',''
|
'csect','csect','csect','csect','','','','','','','',''
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user