[PATCH] D15335: [ELF] - R_X86_64_SIZE64/R_X86_64_SIZE32 relocations implemented.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 01:44:25 PST 2015


grimar added inline comments.

================
Comment at: ELF/Target.cpp:510-511
@@ +509,4 @@
+                                      const SymbolBody &S) const {
+  return (Type == R_X86_64_SIZE32 || Type == R_X86_64_SIZE64) &&
+         canBePreempted(&S, false);
+}
----------------
ruiu wrote:
> Is this correct? If my understanding is correct, if a symbol can be preempted, SIZE relocations for the symbol are ignored in this implementation. Is this what you expected?
Keyword here "Dyn", this method checks if size relocation requires dynamic reloc.

If symbol can be preempted then it requires dynamic size relocation R_X86_64_SIZE64/R_X86_64_SIZE32 which is placed to .rela.dyn, and relocation calculation therefore ignored. For not CBP symbols I dont create dynamic relocation and resolve it during static link. 
That how it works I believe, and covered in tests (relocation-size-shared.s both resolves some size relocs statically and also creates few dynamic ones).



http://reviews.llvm.org/D15335





More information about the llvm-commits mailing list