[PATCH] D13565: [ELF2] Allow PPC64 to add the TOC-restore after .plt-based relocations

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 11:05:52 PDT 2015


hfinkel added a comment.

In http://reviews.llvm.org/D13565#263097, @ruiu wrote:

> What if the linker has to write an instruction to restore the register but there's no space at end of function? This patch simply don't do anything for such functions, but if that works without the instruction, then why do we need that in the first place?


Generically you're correct, however, some code that calls functions that don't return (like _exit) will omit the trailing nop, and furthermore, will appear at the end of a function. Since they don't return, they legitimately don't need the TOC restore.


http://reviews.llvm.org/D13565





More information about the llvm-commits mailing list