mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 05:18:12 +02:00
+ gcc_except_table section
+ support exception related sections in the default LD linker script
git-svn-id: branches/debug_eh@41285 -
(cherry picked from commit 27ab140dd9
)
This commit is contained in:
parent
4e5fb2c6a8
commit
39401708f3
@ -74,10 +74,10 @@ interface
|
||||
{ is the label only there for getting an DataOffset (e.g. for i/o
|
||||
checks -> alt_addr) or is it a jump target (alt_jump), for debug
|
||||
info alt_dbgline and alt_dbgfile, etc. }
|
||||
TAsmLabelType = (alt_jump,alt_addr,alt_data,alt_dbgline,alt_dbgfile,alt_dbgtype,alt_dbgframe);
|
||||
TAsmLabelType = (alt_jump,alt_addr,alt_data,alt_dbgline,alt_dbgfile,alt_dbgtype,alt_dbgframe,alt_eh_begin,alt_eh_end);
|
||||
|
||||
const
|
||||
asmlabeltypeprefix : array[TAsmLabeltype] of char = ('j','a','d','l','f','t','c');
|
||||
asmlabeltypeprefix : array[TAsmLabeltype] of string[2] = ('j','a','d','l','f','t','c','eb','ee');
|
||||
asmsymbindname : array[TAsmsymbind] of string[23] = ('none', 'external','common',
|
||||
'local','global','weak external','private external','lazy','import','internal temp',
|
||||
'indirect','external indirect');
|
||||
@ -166,7 +166,9 @@ interface
|
||||
{ stack segment for 16-bit DOS }
|
||||
sec_stack,
|
||||
{ initial heap segment for 16-bit DOS }
|
||||
sec_heap
|
||||
sec_heap,
|
||||
{ dwarf based/gcc style exception handling }
|
||||
sec_gcc_except_table
|
||||
);
|
||||
|
||||
TObjCAsmSectionType = sec_objc_class..sec_objc_protolist;
|
||||
|
@ -271,7 +271,8 @@ implementation
|
||||
'.obcj_nlcatlist',
|
||||
'.objc_protolist',
|
||||
'.stack',
|
||||
'.heap'
|
||||
'.heap',
|
||||
'.gcc_except_table'
|
||||
);
|
||||
secnames_pic : array[TAsmSectiontype] of string[length('__DATA, __datacoal_nt,coalesced')] = ('','',
|
||||
'.text',
|
||||
@ -330,7 +331,8 @@ implementation
|
||||
'.obcj_nlcatlist',
|
||||
'.objc_protolist',
|
||||
'.stack',
|
||||
'.heap'
|
||||
'.heap',
|
||||
'.gcc_except_table'
|
||||
);
|
||||
var
|
||||
sep : string[3];
|
||||
@ -1890,7 +1892,8 @@ implementation
|
||||
sec_none (* sec_objc_nlcatlist *),
|
||||
sec_none (* sec_objc_protlist *),
|
||||
sec_none (* sec_stack *),
|
||||
sec_none (* sec_heap *)
|
||||
sec_none (* sec_heap *),
|
||||
sec_none (* gcc_except_table *)
|
||||
);
|
||||
begin
|
||||
Result := inherited SectionName (SecXTable [AType], AName, AOrder);
|
||||
|
@ -1256,7 +1256,8 @@ implementation
|
||||
{sec_objc_nlcatlist} [oso_data,oso_load],
|
||||
{sec_objc_protolist'} [oso_data,oso_load],
|
||||
{stack} [oso_load,oso_write],
|
||||
{heap} [oso_load,oso_write]
|
||||
{heap} [oso_load,oso_write],
|
||||
{gcc_except_table} [oso_data,oso_load]
|
||||
);
|
||||
begin
|
||||
result:=secoptions[atype];
|
||||
|
@ -592,7 +592,8 @@ implementation
|
||||
'.obcj_nlcatlist',
|
||||
'.objc_protolist',
|
||||
'.stack',
|
||||
'.heap'
|
||||
'.heap',
|
||||
'.gcc_except_table'
|
||||
);
|
||||
|
||||
const go32v2stub : array[0..2047] of byte=(
|
||||
|
@ -557,7 +557,8 @@ implementation
|
||||
'.obcj_nlcatlist',
|
||||
'.objc_protolist',
|
||||
'.stack',
|
||||
'.heap'
|
||||
'.heap',
|
||||
'.gcc_except_table'
|
||||
);
|
||||
var
|
||||
sep : string[3];
|
||||
|
@ -86,7 +86,8 @@ interface
|
||||
'obcj_nlcatlist',
|
||||
'objc_protolist',
|
||||
'stack',
|
||||
'heap'
|
||||
'heap',
|
||||
'gcc_except_table'
|
||||
);
|
||||
|
||||
{ OMF record types }
|
||||
@ -2820,7 +2821,8 @@ implementation
|
||||
{objc_nlcatlist} 'DATA',
|
||||
{objc_protolist} 'DATA',
|
||||
{stack} 'STACK',
|
||||
{heap} 'HEAP'
|
||||
{heap} 'HEAP',
|
||||
{gcc_except_table} 'DATA'
|
||||
);
|
||||
begin
|
||||
result:=segclass[atype];
|
||||
|
@ -1303,9 +1303,17 @@ begin
|
||||
add(' {');
|
||||
add(' *(.rodata .rodata.* .gnu.linkonce.r.*)');
|
||||
add(' }');
|
||||
add(' .rodata1 : { *(.rodata1) }');
|
||||
add(' .eh_frame_hdr : { *(.eh_frame_hdr) }');
|
||||
add(' .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }');
|
||||
add(' .gcc_except_table : { KEEP *(.gcc_except_table .gcc_except_table.*) }');
|
||||
|
||||
{Adjust the address for the data segment. We want to adjust up to
|
||||
the same address within the page on the next page up.}
|
||||
add(' . = ALIGN (0x1000) - ((0x1000 - .) & (0x1000 - 1));');
|
||||
add(' /* Exception handling */');
|
||||
add(' .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }');
|
||||
add(' .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }');
|
||||
add(' .dynamic : { *(.dynamic) }');
|
||||
add(' .got : { *(.got) }');
|
||||
add(' .got.plt : { *(.got.plt) }');
|
||||
|
@ -149,6 +149,7 @@ implementation
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
@ -201,6 +202,7 @@ implementation
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
|
@ -556,7 +556,8 @@ interface
|
||||
'.obcj_nlcatlist',
|
||||
'.objc_protolist',
|
||||
'.stack',
|
||||
'.heap'
|
||||
'.heap',
|
||||
',gcc_except_table'
|
||||
);
|
||||
var
|
||||
secname,secgroup: string;
|
||||
|
Loading…
Reference in New Issue
Block a user