Commit Graph

3 Commits

Author SHA1 Message Date
George Rimar c191acf097 [ELF] - Implemented -z combrelocs/nocombreloc.
This is the option which sorts relocs to optimize dynamic linker performance.
-z combelocs is the default in gold, also it ignores -z nocombreloc,
this patch do the same.

Patch sorts relocations by symbols only and do not create any
DT_REL[A]COUNT entries. That is different with what gold/bfd do.

More information about option is here:
http://www.airs.com/blog/archives/186
http://people.redhat.com/jakub/prelink.pdf, p.2

Differential revision: http://reviews.llvm.org/D19528

llvm-svn: 269066
2016-05-10 15:47:57 +00:00
Rafael Espindola 435c00f39c Fix the aarch64 logic for dynamic relocations.
There is nothing aarch64 specific in here. If a symbol can be preempted,
we need to copy the full relocation to the dynamic linker.

If a symbol cannot be preempted, we can make the dynamic linker life
easier and produce a relative relocation.

This is directly equivalent to R_X86_64_64 to R_x86_64_RELATIVE
conversion.

llvm-svn: 261678
2016-02-23 20:19:44 +00:00
Adhemerval Zanella 668ad0ffcb [lld] [ELF/AArch64] Fix R_AARCH64_ABS64 in Shared mode
This patch fixes the R_AARCH64_ABS64 relocation when used in shared mode,
where it requires a dynamic R_AARCH64_RELATIVE relocation. To correct set
the addend on the dynamic relocation (since it will be used by the dynamic
linker), a new TargetInfo specific hook was created (getDynRelativeAddend)
to get the correct addend based on relocation type.

The patch fixes the issues when creating shared library code against
{init,fini}_array, where it issues R_AARCH64_ABS64 relocation against
local symbols.

llvm-svn: 261651
2016-02-23 16:54:40 +00:00