This is an archive of the discontinued LLVM Phabricator instance.

[COFF] Improve relocation against discarded section error
ClosedPublic

Authored by rnk on Nov 7 2018, 4:50 PM.

Details

Summary

Reuse the "referenced by" note diagnostic code that we already use for
undefined symbols. In my case, it turned this:

lld-link: error: relocation against symbol in discarded section: .text
lld-link: error: relocation against symbol in discarded section: .text
...

Into this:

lld-link: error: relocation against symbol in discarded section: .text
>>> referenced by libANGLE.lib(CompilerGL.obj):(.SCOVP$M)
>>> referenced by libANGLE.lib(CompilerGL.obj):(.SCOVP$M)
...

lld-link: error: relocation against symbol in discarded section: .text
>>> referenced by obj/third_party/angle/libGLESv2/entry_points_egl_ext.obj:(.SCOVP$M)
>>> referenced by obj/third_party/angle/libGLESv2/entry_points_egl_ext.obj:(.SCOVP$M)
...

I think the new output is more useful.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

rnk created this revision.Nov 7 2018, 4:50 PM
ruiu accepted this revision.Nov 7 2018, 4:57 PM

LGTM

This revision is now accepted and ready to land.Nov 7 2018, 4:57 PM
This revision was automatically updated to reflect the committed changes.