mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 01:08:07 +02:00
+ write .option pic directive if needed
This commit is contained in:
parent
e7ae57b0cd
commit
57da25581e
@ -1958,6 +1958,9 @@ implementation
|
||||
name has to be translated as well }
|
||||
if dir=asd_cpu then
|
||||
writer.AsmWrite(asminfo^.comment+' CPU ')
|
||||
{ indent for easier reading }
|
||||
else if dir in [asd_option] then
|
||||
writer.AsmWrite(#9'.'+directivestr[dir]+' ')
|
||||
else
|
||||
writer.AsmWrite('.'+directivestr[dir]+' ');
|
||||
end;
|
||||
|
55
compiler/riscv/nrvutil.pas
Normal file
55
compiler/riscv/nrvutil.pas
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
Copyright (c) 2024
|
||||
|
||||
RISCV version of some node tree helper routines
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
****************************************************************************
|
||||
}
|
||||
unit nrvutil;
|
||||
|
||||
{$i fpcdefs.inc}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
ngenutil;
|
||||
|
||||
|
||||
type
|
||||
trvnodeutils = class(tnodeutils)
|
||||
class procedure InsertObjectInfo; override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
globtype,globals,
|
||||
systems,
|
||||
aasmdata,aasmtai;
|
||||
|
||||
class procedure trvnodeutils.InsertObjectInfo;
|
||||
begin
|
||||
inherited InsertObjectInfo;
|
||||
if (target_info.system in systems_linux) and (cs_create_pic in current_settings.moduleswitches) then
|
||||
current_asmdata.asmlists[al_start].Concat(tai_directive.create(asd_option,'pic'));
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
cnodeutils:=trvnodeutils;
|
||||
end.
|
||||
|
@ -29,12 +29,12 @@ interface
|
||||
cclasses,
|
||||
fmodule,
|
||||
node,nbas,
|
||||
ngenutil,
|
||||
nrvutil,
|
||||
symtype,symconst,symsym,symdef;
|
||||
|
||||
|
||||
type
|
||||
trv32nodeutils = class(tnodeutils)
|
||||
trv32nodeutils = class(trvnodeutils)
|
||||
protected
|
||||
class procedure insert_init_final_table(main: tmodule; entries:tfplist); override;
|
||||
end;
|
||||
|
@ -45,7 +45,8 @@ uses
|
||||
nrvinl,
|
||||
nrv64mat,
|
||||
nrv64cnv,
|
||||
nrv64ld
|
||||
nrv64ld,
|
||||
nrvutil
|
||||
{$else not llvm}
|
||||
llvmnode
|
||||
{$endif not llvm}
|
||||
|
Loading…
Reference in New Issue
Block a user