* only use ".set" directive when creating dwarf relsyms on darwin and

not for other relsyms, as older versions of the darwin assembler
    don't understand the ".set" directive (mantis #10541)

git-svn-id: trunk@9621 -
This commit is contained in:
Jonas Maebe 2008-01-03 12:47:31 +00:00
parent 7dac4e7e81
commit db6e60789b
3 changed files with 32 additions and 9 deletions

View File

@ -96,7 +96,22 @@ interface
aitconst_rva_symbol, aitconst_rva_symbol,
aitconst_secrel32_symbol, aitconst_secrel32_symbol,
{ darwin only } { darwin only }
aitconst_indirect_symbol aitconst_indirect_symbol,
{ From gcc/config/darwin.c (darwin_asm_output_dwarf_delta):
***
Output a difference of two labels that will be an assembly time
constant if the two labels are local. (.long lab1-lab2 will be
very different if lab1 is at the boundary between two sections; it
will be relocated according to the second section, not the first,
so one ends up with a difference between labels in different
sections, which is bad in the dwarf2 eh context for instance.)
***
We cannot use this everywhere, because older versions of the
darwin assembler don't support the construct used for these
relsyms (nor do they support dwarf, for that matter)
}
aitconst_darwin_dwarf_delta64,
aitconst_darwin_dwarf_delta32
); );
const const

View File

@ -205,10 +205,10 @@ implementation
const const
ait_const2str : array[aitconst_128bit..aitconst_indirect_symbol] of string[20]=( ait_const2str : array[aitconst_128bit..aitconst_darwin_dwarf_delta32] of string[20]=(
#9'.fixme128'#9,#9'.quad'#9,#9'.long'#9,#9'.short'#9,#9'.byte'#9, #9'.fixme128'#9,#9'.quad'#9,#9'.long'#9,#9'.short'#9,#9'.byte'#9,
#9'.sleb128'#9,#9'.uleb128'#9, #9'.sleb128'#9,#9'.uleb128'#9,
#9'.rva'#9,#9'.secrel32'#9,#9'.indirect_symbol'#9 #9'.rva'#9,#9'.secrel32'#9,#9'.indirect_symbol'#9,#9'.quad'#9,#9'.long'#9
); );
{****************************************************************************} {****************************************************************************}
@ -695,10 +695,12 @@ implementation
aitconst_8bit, aitconst_8bit,
aitconst_rva_symbol, aitconst_rva_symbol,
aitconst_secrel32_symbol, aitconst_secrel32_symbol,
aitconst_indirect_symbol : aitconst_indirect_symbol,
aitconst_darwin_dwarf_delta32,
aitconst_darwin_dwarf_delta64:
begin begin
if (target_info.system in systems_darwin) and if (target_info.system in systems_darwin) and
(tai_const(hp).consttype in [aitconst_uleb128bit,aitconst_sleb128bit]) then (constdef in [aitconst_uleb128bit,aitconst_sleb128bit]) then
begin begin
AsmWrite(ait_const2str[aitconst_8bit]); AsmWrite(ait_const2str[aitconst_8bit]);
case tai_const(hp).consttype of case tai_const(hp).consttype of
@ -710,7 +712,7 @@ implementation
end end
else else
begin begin
AsmWrite(ait_const2str[tai_const(hp).consttype]); AsmWrite(ait_const2str[constdef]);
l:=0; l:=0;
t := ''; t := '';
repeat repeat
@ -718,7 +720,7 @@ implementation
begin begin
if assigned(tai_const(hp).endsym) then if assigned(tai_const(hp).endsym) then
begin begin
if (target_info.system in systems_darwin) then if (constdef in [aitconst_darwin_dwarf_delta32,aitconst_darwin_dwarf_delta64]) then
begin begin
s := NextSetLabel; s := NextSetLabel;
t := #9'.set '+s+','+tai_const(hp).endsym.name+'-'+tai_const(hp).sym.name; t := #9'.set '+s+','+tai_const(hp).endsym.name+'-'+tai_const(hp).sym.name;

View File

@ -643,11 +643,17 @@ implementation
offsetabstype:=aitconst_secrel32_symbol offsetabstype:=aitconst_secrel32_symbol
else else
offsetabstype:=aitconst_32bit; offsetabstype:=aitconst_32bit;
offsetreltype:=aitconst_32bit; if (target_info.system in systems_darwin) then
offsetreltype:=aitconst_darwin_dwarf_delta32
else
offsetreltype:=aitconst_32bit;
end end
else else
begin begin
offsetreltype:=aitconst_64bit; if (target_info.system in systems_darwin) then
offsetreltype:=aitconst_darwin_dwarf_delta64
else
offsetreltype:=aitconst_64bit;
offsetabstype:=aitconst_64bit; offsetabstype:=aitconst_64bit;
end; end;
end; end;