This is an archive of the discontinued LLVM Phabricator instance.

Use the plt entry as the address of some symbols
ClosedPublic

Authored by rafael on Feb 8 2016, 4:21 PM.

Details

Summary

This is the function equivalent of a copy relocation.

Since functions are expected to change sizes, we cannot use copy relocations. In situations where one would be needed, what is done instead is:

  • Create a plt entry
  • Output an undefined symbol whose addr is the plt entry.

The dynamic linker makes sure any shared library uses the plt entry as the function address.

Diff Detail

Repository
rL LLVM

Event Timeline

rafael updated this revision to Diff 47269.Feb 8 2016, 4:21 PM
rafael retitled this revision from to Use the plt entry as the address of some symbols.
rafael updated this object.
rafael added reviewers: ruiu, atanasyan, silvas.
rafael set the repository for this revision to rL LLVM.
rafael added a subscriber: llvm-commits.
atanasyan accepted this revision.Feb 8 2016, 10:15 PM
atanasyan edited edge metadata.

LGTM

Thanks for the quick fix. Unfortunately as usual supporting the same functionality for MIPS requires at least one if (Config->EMachine == EM_MIPS) statement.

This revision is now accepted and ready to land.Feb 8 2016, 10:15 PM
atanasyan closed this revision.Feb 11 2016, 6:37 AM

Closed by commit rL260224.