Page MenuHomePhabricator

[LLD][PPC] Small data section handling with synthetic _SDA_BASE_ symbols
Needs ReviewPublic

Authored by jackoalan on Nov 6 2016, 11:28 PM.

Details

Reviewers
hfinkel
Summary

LLD-side extension of D26344.

This implements R_PPC_EMB_SDA21 relocations in executable targets. C runtime init implementations may use _SDA_BASE_ and _SDA2_BASE_ symbols to globally initialize r13 and r2 respectively.

This patch also adds other relocations that LLVM itself may emit during PPC target lowering, and also enables target bi-endianness.

Diff Detail

Repository
rL LLVM

Event Timeline

jackoalan updated this revision to Diff 77014.Nov 6 2016, 11:28 PM
jackoalan retitled this revision from to [LLD][PPC] Small data section handling with synthetic _SDA_BASE_ symbols.
jackoalan updated this object.
jackoalan added a reviewer: hfinkel.
jackoalan set the repository for this revision to rL LLVM.
jackoalan added a subscriber: lld.
jackoalan updated this revision to Diff 77692.Nov 11 2016, 3:57 PM
jackoalan removed rL LLVM as the repository for this revision.

Rebase with upstream master. Add -sda-base= and -sda2-base= linker options for overriding synthetic values.

jackoalan updated this revision to Diff 77730.Nov 12 2016, 3:54 PM

_SDA_BASE_ symbols need direct calls to ElfSym<ELFT>::addSynthetic to be initially created.

jackoalan updated this revision to Diff 77733.Nov 12 2016, 6:54 PM

Add PPCTargetInfo::relocateOne() R_PPC_ADDR14 and R_PPC_REL14 handling.

jackoalan updated this revision to Diff 78317.Nov 16 2016, 8:18 PM

Make PPC target bi-endian in the same manner as MIPS. Tidy up PPCTargetInfo::relocateOne(). Rebase with latest master

jackoalan updated this object.Nov 16 2016, 8:25 PM
jackoalan updated this revision to Diff 78417.Nov 17 2016, 1:39 PM

Ensure Config->OSABI == ELF::ELFOSABI_STANDALONE is true when synthesizing _SDA_BASE_ symbols.

Also add relocation tests for ADDR14 and REL14.

jackoalan updated this revision to Diff 78453.Nov 17 2016, 6:39 PM

Test now uses sda21 symbol variant as changed from sdarx.

jackoalan updated this revision to Diff 78601.Nov 18 2016, 4:38 PM

Implement getBitcodeOSABIKind, which just responds to Triple::EABI for now.

jackoalan updated this revision to Diff 79810.Nov 30 2016, 1:53 PM

Rebase against upstream master. Cleanup PPCTargetInfo::relocateOne() with mask constants.