This is an archive of the discontinued LLVM Phabricator instance.

[ELF2] R_X86_64_64 plt relocation implemented.
ClosedPublic

Authored by grimar on Oct 28 2015, 10:41 AM.

Details

Summary

This little patch is a final point in fix for https://llvm.org/bugs/show_bug.cgi?id=25175.

It`s make sample from issue description to work with -O0 optimization flag (with -O0 it generates R_X86_64_64 plt relocation).
Previous patch that implemented copy relocations (http://reviews.llvm.org/D14090) fixed -O1,2,3 cases.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar updated this revision to Diff 38672.Oct 28 2015, 10:41 AM
grimar retitled this revision from to [ELF2] R_X86_64_64 plt relocation implemented..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: grimar, llvm-commits.
ruiu accepted this revision.Oct 28 2015, 10:49 AM
ruiu edited edge metadata.

LGTM with a nit.

ELF/Target.cpp
265–274 ↗(On Diff #38672)

This function is called only when relocNeedsPlt returns true, so

if (Type == R_X86_64_PLT32)
  return R_X86_64_PC32;
return Type;
This revision is now accepted and ready to land.Oct 28 2015, 10:49 AM
This revision was automatically updated to reflect the committed changes.