This is an archive of the discontinued LLVM Phabricator instance.

[Libomptarget] Build plugins with protected visibility by default
ClosedPublic

Authored by jhuber6 on Oct 20 2022, 8:57 AM.

Details

Summary

The plugins all define the same interface symbols. This is generally not
a problem when calling the plugin directly from the dynamic library's
handle. However, when calling from within the plugin itself it is
possible for another plugin's symbols to preempt the symbols. This was
observed with the __tgt_rtl_is_valid_binary call in the
__tgt_rtl_is_valid_binary_info function being mapped to the x86_64
plugin.

This patch changes the default visibility to protected intead. This
visibility ensures that these symbols are all externally visible from
the plugin, but ensures their definitions are fixed within the shared
library. Having protected visiiblity makes such symbol preemption
impossible.

Diff Detail

Event Timeline

jhuber6 created this revision.Oct 20 2022, 8:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 8:57 AM
jhuber6 requested review of this revision.Oct 20 2022, 8:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 8:57 AM
This revision is now accepted and ready to land.Oct 20 2022, 9:00 AM