mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 03:29:34 +01:00
+ custom section name support for llvm
git-svn-id: trunk@32400 -
This commit is contained in:
parent
92ba1c90a1
commit
91e8f4c439
@ -165,9 +165,11 @@ interface
|
||||
sec: TAsmSectiontype;
|
||||
alignment: shortint;
|
||||
flags: taillvmdeclflags;
|
||||
secname: TSymStr;
|
||||
constructor createdecl(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype; _alignment: shortint);
|
||||
constructor createdef(_namesym: tasmsymbol; _def: tdef; _initdata: tasmlist; _sec: tasmsectiontype; _alignment: shortint);
|
||||
constructor createtls(_namesym: tasmsymbol; _def: tdef; _alignment: shortint);
|
||||
procedure setsecname(const name: TSymStr);
|
||||
destructor destroy; override;
|
||||
end;
|
||||
|
||||
@ -221,6 +223,14 @@ uses
|
||||
end;
|
||||
|
||||
|
||||
procedure taillvmdecl.setsecname(const name: TSymStr);
|
||||
begin
|
||||
if sec<>sec_user then
|
||||
internalerror(2015111501);
|
||||
secname:=name;
|
||||
end;
|
||||
|
||||
|
||||
destructor taillvmdecl.destroy;
|
||||
begin
|
||||
initdata.free;
|
||||
|
||||
@ -1001,6 +1001,13 @@ implementation
|
||||
end;
|
||||
dec(fdecllevel);
|
||||
end;
|
||||
{ custom section name? }
|
||||
if taillvmdecl(hp).sec=sec_user then
|
||||
begin
|
||||
writer.AsmWrite(', section "');
|
||||
writer.AsmWrite(taillvmdecl(hp).secname);
|
||||
writer.AsmWrite('"');
|
||||
end;
|
||||
{ alignment }
|
||||
writer.AsmWrite(', align ');
|
||||
writer.AsmWriteln(tostr(taillvmdecl(hp).alignment));
|
||||
|
||||
@ -162,13 +162,12 @@ implementation
|
||||
newasmlist: tasmlist;
|
||||
decl: taillvmdecl;
|
||||
begin
|
||||
{ todo }
|
||||
if section = sec_user then
|
||||
internalerror(2014052904);
|
||||
newasmlist:=tasmlist.create;
|
||||
{ llvm declaration with as initialisation data all the elements from the
|
||||
original asmlist }
|
||||
decl:=taillvmdecl.createdef(sym,def,fasmlist,section,alignment);
|
||||
if section=sec_user then
|
||||
decl.setsecname(secname);
|
||||
if tcalo_is_lab in options then
|
||||
include(decl.flags,ldf_unnamed_addr);
|
||||
{ TODO: tcalo_no_dead_strip: add to @llvm.user meta-variable }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user