ELF: Export preempted symbols even if there is a dynamic list.
ClosedPublic

Authored by pcc on Fri, Oct 6, 2:00 PM.

Details

Summary

Dynamic lists in an executable are additive, not restrictive, so we
must continue to export preempted symbols even with a dynamic list.

This fixes sanitizer interception of libc symbols (and should also fix
symbol preemption by users of sanitizers).

Diff Detail

Repository
rL LLVM
pcc created this revision.Fri, Oct 6, 2:00 PM
ruiu added inline comments.Fri, Oct 6, 2:15 PM
lld/ELF/Driver.cpp
787–789 ↗(On Diff #118078)

So, was this just wrong?

pcc added inline comments.Fri, Oct 6, 2:27 PM
lld/ELF/Driver.cpp
787–789 ↗(On Diff #118078)

I think so, yes. Dynamic lists in executables are additive, while version scripts in DSOs are restrictive, so there's no direct conversion between them.

ruiu accepted this revision.Fri, Oct 6, 2:33 PM

LGTM

This revision is now accepted and ready to land.Fri, Oct 6, 2:33 PM
This revision was automatically updated to reflect the committed changes.