[PATCH] D15043: [ELF/AArch64] Add support for the R_AARCH64_COPY relocation.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 27 09:33:46 PST 2015


ruiu added inline comments.

================
Comment at: ELF/Target.cpp:917-919
@@ +916,5 @@
+  case R_AARCH64_ABS64:
+  case R_AARCH64_PREL16:
+  case R_AARCH64_PREL32:
+  case R_AARCH64_PREL64:
+  case R_AARCH64_ADR_PREL_LO21:
----------------
ikudrin wrote:
> ruiu wrote:
> > ikudrin wrote:
> > > ruiu wrote:
> > > > ikudrin wrote:
> > > > > ruiu wrote:
> > > > > > These are GOT-relative relocations. Do you need to create copy relocations for them?
> > > > > They are in the same table "4-6, Data relocations" and in the same section "4.6.5 Static Data relocations" as R_AARCH64_ABS* in the following spec: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0056b/IHI0056B_aaelf64.pdf.
> > > > > 
> > > > > Can you hint me for some other specs?
> > > > I'm sorry if that's not clear, I pointed out PREL relocations. (I selected these three lines on Phab, but Phab includes plus/minus one lines to the diff in addition to the selection I made on the web UI.)
> > > Yes, I've commented the same lines, about _PREL* relocs. I have to admit that I haven't found a real sample to check all of them. I filled the list basing mostly on my understanding of specs. I'll really appreciate any hints and samples.
> > Since they are GOT-relative, all code that uses these relocations should always reference data through GOT, so no need to create copy relocations. Gold doesn't create copy relocations for them too.
> The spec says that they are position-relative, not GOT-relative. http://infocenter.arm.com/help/topic/com.arm.doc.ihi0056b/IHI0056B_aaelf64.pdf.
> Am I wrong? Do you have the other spec?
Hm, I may have misread the spec. But could you take a look at gold? It seems to me that they do not create copy relocations for them.


http://reviews.llvm.org/D15043





More information about the llvm-commits mailing list