[PATCH] D18731: ELF: Create dynamic symbols for symbol aliases of copy relocations.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 2 14:35:06 PDT 2016


pcc created this revision.
pcc added reviewers: ruiu, rafael.
pcc added a subscriber: llvm-commits.

For each copy relocation that we create, look through the DSO's symbol table
for aliases and create a dynamic symbol for each one. This causes the copy
relocation to correctly interpose any aliases.

Copy relocations are relatively uncommon (on my machine, 56% of binaries in
/usr/bin have no copy relocations probably due to being PIEs, 97% of them
have <10, and the binary with the largest number of them has 97) so it's
probably fine to do this in a relatively inefficient way.

http://reviews.llvm.org/D18731

Files:
  ELF/OutputSections.cpp
  ELF/Writer.cpp
  test/ELF/Inputs/relocation-copy-alias.s
  test/ELF/relocation-copy-alias.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18731.52479.patch
Type: text/x-patch
Size: 5670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160402/ec1b980a/attachment.bin>


More information about the llvm-commits mailing list