This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Do not skip relocation scanning checkins if the symbol gets dynamic COPY relocation already
ClosedPublic

Authored by atanasyan on Apr 7 2016, 7:51 AM.

Details

Summary

It is possible that the same symbol referenced by two kinds of relocations at the same time. The first type requires say GOT entry creation, the second type requires dynamic copy relocation. For MIPS targets they might be R_MIPS_GOT16 and R_MIPS_HI16 relocations. For X86 target they might be R_386_GOT32 and R_386_32 respectively.

Now LLD never creates GOT entry for a symbol if this symbol already has related copy relocation. This patch solves this problem.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 52922.Apr 7 2016, 7:51 AM
atanasyan retitled this revision from to [ELF] Do not skip relocation scanning checkins if the symbol gets dynamic COPY relocation already.
atanasyan updated this object.
atanasyan added reviewers: rafael, ruiu.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a project: lld.
atanasyan added a subscriber: llvm-commits.
rafael edited edge metadata.Apr 10 2016, 8:28 AM
rafael added a subscriber: rafael.

LGTM with the i386 test case added.

Cheers,
Rafael

This revision was automatically updated to reflect the committed changes.

Thanks for review.