This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Allow calls to a protected function in a shared library from non-PIC code.
AbandonedPublic

Authored by grimar on Nov 10 2016, 4:40 AM.

Details

Reviewers
ruiu
rafael
Summary

GNU linkers allow to do that,
this should fix the https://llvm.org/bugs/show_bug.cgi?id=30960.

Diff Detail

Event Timeline

grimar updated this revision to Diff 77467.Nov 10 2016, 4:40 AM
grimar retitled this revision from to [ELF] - Allow calls to a protected function in a shared library from non-PIC code..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777.

Will update in a minute.

grimar updated this revision to Diff 77470.Nov 10 2016, 4:46 AM
  • Added correct testcase.
rafael added inline comments.Nov 10 2016, 5:08 AM
ELF/Relocations.cpp
449

I think this is wrong.

It is possible that we should accept the test for other reasons, but at this point in the code we are trying to preempt a symbol, and that is not possible with protected visibility.

It is possible the address is not significant, but we don't know that. There is no flag in ELF to inform us.

grimar abandoned this revision.Feb 16 2017, 7:18 AM

Solution is incorrect, more details available at PR page (https://bugs.llvm.org//show_bug.cgi?id=30960)