+ support for emitting weak symbols with the high level typed constant builder

git-svn-id: trunk@32883 -
This commit is contained in:
Jonas Maebe 2016-01-07 22:06:06 +00:00
parent 58ae32e2d1
commit 53bf43983a
2 changed files with 8 additions and 1 deletions

View File

@ -126,7 +126,9 @@ type
{ item in the above list }
tcalo_vectorized_dead_strip_item,
{ end of the above list }
tcalo_vectorized_dead_strip_end
tcalo_vectorized_dead_strip_end,
{ symbol should be weakle defined }
tcalo_weak
);
ttcasmlistoptions = set of ttcasmlistoption;
@ -941,6 +943,9 @@ implementation
prelist.concat(tai_symbol.Create_Global(sym,0))
else
prelist.concat(tai_label.Create(tasmlabel(sym)));
if tcalo_weak in options then
prelist.concat(tai_directive.Create(asd_weak_definition,sym.name));
{ insert the symbol information before the data }
fasmlist.insertlist(prelist);
{ end of the symbol }

View File

@ -988,6 +988,8 @@ implementation
writer.AsmWrite(' =');
WriteLinkageVibilityFlags(taillvmdecl(hp).namesym.bind);
writer.AsmWrite(' ');
if ldf_weak in taillvmdecl(hp).flags then
writer.AsmWrite('weak ');
if (ldf_tls in taillvmdecl(hp).flags) then
writer.AsmWrite('thread_local ');
if ldf_unnamed_addr in taillvmdecl(hp).flags then