This "fixes" PR36678 by just producing an error when we find a case where we would produce an plt entry that used ebx but ebx would not be set.
Diff Detail
Event Timeline
George Rimar via Phabricator via llvm-commits
<llvm-commits@lists.llvm.org> writes:
grimar added inline comments.
Comment at: ELF/Arch/X86.cpp:68
+ compiled without -fPIE/-fPIC and doesn't maintain ebx.
+ * If a libray definition gets preempted to the executable, it will have the+ // wrong ebx value.
a library
Thanks.
Comment at: ELF/Arch/X86.cpp:70
+ // wrong ebx value.
+ if (Config->Pic)+ SupportsPltPreemption = false;
Comment saying "for PIE", but Config->Pic also covers DSO, we have Config->Pie for PIE. Is this if correct?
We will report "cannot be used against symbol" for -shared case, so I think it can be if (Config->Pie).
They would be equivalent as the canonical plt hack never works for
shared libraries, but using Pie is definitely better.
I will upload a new version.
Thanks,
Rafael
ELF/Relocations.cpp | ||
---|---|---|
878 | I wouldn't generalize this as a Target member because I believe you need it only for i386. Even if there are two or more targets that need this, you could generalize when you add another arch. | |
879–880 | Please add a hint to the error message about how to fix the problem. You could fix this by recompiling with -fPIC, right? |
I wouldn't generalize this as a Target member because I believe you need it only for i386. Even if there are two or more targets that need this, you could generalize when you add another arch.