* generate jump tables into the same section as the code as otherwise we'll get bogus relocations (in case of clang.exe) or a future support for armasm64.exe will reject the relative symbols outright

git-svn-id: trunk@44949 -
This commit is contained in:
svenbarth 2020-04-21 06:06:36 +00:00
parent b88107fa1d
commit 7f4b94e408

View File

@ -42,7 +42,7 @@ implementation
uses
systems,
verbose,globals,constexp,
verbose,globals,constexp,cutils,
symconst,symdef,defutil,
paramgr,
cpuinfo,
@ -254,6 +254,18 @@ implementation
{ and finally jump }
current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_BR,jumpreg));
{ generate jump table }
if target_info.system=system_aarch64_win64 then
begin
{ for Windows we need to make sure that the jump table is located in the
same section as the corresponding code as for one clang generates a
ABSOLUTE32 relocation that can not be handled correctly and armasm64
rejects the difference entries due to the symbols being located in
different sections }
sectype:=sec_code;
new_section(current_procinfo.aktlocaldata,sectype,lower(current_procinfo.procdef.mangledname),getprocalign);
end
else
begin
if not(target_info.system in systems_darwin) then
sectype:=sec_rodata
else
@ -272,6 +284,7 @@ implementation
sectype:=sec_code;
end;
new_section(current_procinfo.aktlocaldata,sectype,current_procinfo.procdef.mangledname,4);
end;
if target_info.system in systems_darwin then
begin
{ additionally, these tables are now marked via ".data_region jt32"