Page MenuHomePhabricator

[MC] Set addrsig symbol as weak/weakExternal
AbandonedPublic

Authored by zequanwu on Apr 21 2021, 1:13 PM.

Details

Reviewers
MaskRay
pcc
rnk
Summary

No all symbols in .addrsig table have definitions. So, setting them as weak to avoid undefined symbol error during linking.

Diff Detail

Unit TestsFailed

TimeTest
160 msx64 windows > lld.COFF::icf-safe.s
Script: -- : 'RUN: at line 2'; c:\ws\w16c2-2\llvm-project\premerge-checks\build\bin\llvm-mc.exe -filetype=obj -triple=x86_64-pc-win32 C:\ws\w16c2-2\llvm-project\premerge-checks\lld\test\COFF\icf-safe.s -o C:\ws\w16c2-2\llvm-project\premerge-checks\build\tools\lld\test\COFF\Output\icf-safe.s.tmp1.obj
380 msx64 windows > lld.ELF/lto::devirt_vcall_vis_export_dynamic.ll
Script: -- : 'RUN: at line 8'; c:\ws\w16c2-2\llvm-project\premerge-checks\build\bin\opt.exe --thinlto-bc -o C:\ws\w16c2-2\llvm-project\premerge-checks\build\tools\lld\test\ELF\lto\Output\devirt_vcall_vis_export_dynamic.ll.tmp2.o C:\ws\w16c2-2\llvm-project\premerge-checks\lld\test\ELF\lto\devirt_vcall_vis_export_dynamic.ll
360 msx64 windows > lld.ELF/lto::devirt_vcall_vis_public.ll
Script: -- : 'RUN: at line 6'; c:\ws\w16c2-2\llvm-project\premerge-checks\build\bin\opt.exe --thinlto-bc -o C:\ws\w16c2-2\llvm-project\premerge-checks\build\tools\lld\test\ELF\lto\Output\devirt_vcall_vis_public.ll.tmp2.o C:\ws\w16c2-2\llvm-project\premerge-checks\lld\test\ELF\lto\devirt_vcall_vis_public.ll
180 msx64 windows > lld.ELF/lto::parallel-internalize.ll
Script: -- : 'RUN: at line 2'; c:\ws\w16c2-2\llvm-project\premerge-checks\build\bin\llvm-as.exe -o C:\ws\w16c2-2\llvm-project\premerge-checks\build\tools\lld\test\ELF\lto\Output\parallel-internalize.ll.tmp.bc C:\ws\w16c2-2\llvm-project\premerge-checks\lld\test\ELF\lto\parallel-internalize.ll

Event Timeline

zequanwu created this revision.Apr 21 2021, 1:13 PM
zequanwu requested review of this revision.Apr 21 2021, 1:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2021, 1:13 PM
pcc added a comment.Apr 21 2021, 1:24 PM

Wouldn't this make all address significant symbols weak external?

The intent is that we don't emit additional symbols if the address significance table is enabled (see e.g. the call to GV.use_empty() before calling emitAddrsigSym in llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp). If you're still seeing undefined symbols with that, I think we need to make that condition more powerful instead.

zequanwu abandoned this revision.Apr 28 2021, 9:42 PM