mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 18:29:27 +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);
|
||||
|
||||
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_custom, { custom section, no prefix }
|
||||
{ stabs }
|
||||
@ -572,7 +572,7 @@ implementation
|
||||
function TAsmObjectData.sectionname(atype:tasmsectiontype;const aname:string):string;
|
||||
const
|
||||
secnames : array[tasmsectiontype] of string[12] = ('',
|
||||
'code','data','rodata','bss','tbss',
|
||||
'code','data','rodata','bss','threadvar',
|
||||
'common',
|
||||
'note',
|
||||
'stab','stabstr',
|
||||
|
@ -281,7 +281,7 @@ var
|
||||
const
|
||||
secnames : array[tasmsectiontype] of string[12] = ('',
|
||||
{$warning TODO .rodata not yet working}
|
||||
'.text','.data','.data','.bss','.tbss',
|
||||
'.text','.data','.data','.bss','.threadvar',
|
||||
'common',
|
||||
'.note',
|
||||
'.stab','.stabstr',
|
||||
@ -291,7 +291,7 @@ var
|
||||
);
|
||||
begin
|
||||
if use_smartlink_section and
|
||||
not (atype in [sec_bss,sec_tbss]) and
|
||||
not (atype in [sec_bss,sec_threadvar]) and
|
||||
(aname<>'') then
|
||||
result:='.gnu.linkonce'+copy(secnames[atype],1,2)+'.'+aname
|
||||
else
|
||||
|
@ -1085,7 +1085,7 @@ Implementation
|
||||
end;
|
||||
ait_datablock :
|
||||
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);
|
||||
l:=used_align(size_2_align(Tai_datablock(hp).size),0,objectdata.currsec.addralign);
|
||||
if Tai_datablock(hp).is_global and
|
||||
@ -1256,7 +1256,7 @@ Implementation
|
||||
case hp.typ of
|
||||
ait_align :
|
||||
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)
|
||||
else
|
||||
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
|
||||
begin
|
||||
list:=asmlist[threadvarsegment];
|
||||
sectype:=sec_tbss;
|
||||
sectype:=sec_threadvar;
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
@ -554,7 +554,7 @@ const go32v2stub : array[0..2047] of byte=(
|
||||
function TCoffObjectData.sectionname(atype:tasmsectiontype;const aname:string):string;
|
||||
const
|
||||
secnames : array[tasmsectiontype] of string[16] = ('',
|
||||
'.text','.data','.data','.bss','.tbss',
|
||||
'.text','.data','.data','.bss','.threadvar',
|
||||
'common',
|
||||
'.note',
|
||||
'.stab','.stabstr',
|
||||
|
@ -236,7 +236,7 @@ implementation
|
||||
AshType:=SHT_PROGBITS;
|
||||
AAlign:=max(sizeof(aint),AAlign);
|
||||
end;
|
||||
sec_bss,sec_tbss :
|
||||
sec_bss,sec_threadvar :
|
||||
begin
|
||||
Ashflags:=SHF_ALLOC or SHF_WRITE;
|
||||
AshType:=SHT_NOBITS;
|
||||
@ -308,7 +308,9 @@ implementation
|
||||
createsection(sec_code,'',0,[]);
|
||||
createsection(sec_data,'',0,[]);
|
||||
createsection(sec_bss,'',0,[]);
|
||||
createsection(sec_tbss,'',0,[]);
|
||||
{$ifdef segment_threadvars}
|
||||
createsection(sec_threadvar,'',0,[]);
|
||||
{$endif}
|
||||
{ create stabs sections if debugging }
|
||||
if (cs_debuginfo in aktmoduleswitches) then
|
||||
begin
|
||||
@ -332,9 +334,9 @@ implementation
|
||||
const
|
||||
secnames : array[tasmsectiontype] of string[12] = ('',
|
||||
{$ifdef userodata}
|
||||
'.text','.data','.rodata','.bss','.tbss',
|
||||
'.text','.data','.rodata','.bss','.threadvar',
|
||||
{$else userodata}
|
||||
'.text','.data','.data','.bss','.tbss',
|
||||
'.text','.data','.data','.bss','.threadvar',
|
||||
{$endif userodata}
|
||||
'common',
|
||||
'.note',
|
||||
@ -345,7 +347,7 @@ implementation
|
||||
);
|
||||
begin
|
||||
if use_smartlink_section and
|
||||
not (atype in [sec_bss,sec_tbss]) and
|
||||
not (atype in [sec_bss,sec_threadvar]) and
|
||||
(aname<>'') then
|
||||
result:='.gnu.linkonce'+copy(secnames[atype],1,2)+'.'+aname
|
||||
else
|
||||
@ -379,7 +381,7 @@ implementation
|
||||
if currsec=nil then
|
||||
internalerror(200403292);
|
||||
{$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);
|
||||
{$endif userodata}
|
||||
if assigned(p) then
|
||||
|
@ -76,7 +76,7 @@ interface
|
||||
'csect', {code}
|
||||
'csect', {data}
|
||||
'csect', {read only data}
|
||||
'csect', {bss}, 'csect',
|
||||
'csect', {bss} 'csect',
|
||||
'csect','csect','csect','csect','','','','','','','',''
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user