@@ -16,8 +16,9 @@ using namespace llvm;
1616using namespace llvm ::object;
1717using namespace llvm ::support::endian;
1818using namespace llvm ::ELF;
19- using namespace lld ;
20- using namespace lld ::elf;
19+
20+ namespace lld {
21+ namespace elf {
2122
2223static uint64_t ppc64TocOffset = 0x8000 ;
2324static uint64_t dynamicThreadPointerOffset = 0x8000 ;
@@ -59,7 +60,7 @@ enum DFormOpcd {
5960 ADDI = 14
6061};
6162
62- uint64_t elf:: getPPC64TocBase () {
63+ uint64_t getPPC64TocBase () {
6364 // The TOC consists of sections .got, .toc, .tocbss, .plt in that order. The
6465 // TOC starts where the first of these sections starts. We always create a
6566 // .got when we see a relocation that uses it, so for us the start is always
@@ -73,7 +74,7 @@ uint64_t elf::getPPC64TocBase() {
7374 return tocVA + ppc64TocOffset;
7475}
7576
76- unsigned elf:: getPPC64GlobalEntryToLocalEntryOffset (uint8_t stOther) {
77+ unsigned getPPC64GlobalEntryToLocalEntryOffset (uint8_t stOther) {
7778 // The offset is encoded into the 3 most significant bits of the st_other
7879 // field, with some special values described in section 3.4.1 of the ABI:
7980 // 0 --> Zero offset between the GEP and LEP, and the function does NOT use
@@ -98,7 +99,7 @@ unsigned elf::getPPC64GlobalEntryToLocalEntryOffset(uint8_t stOther) {
9899 return 0 ;
99100}
100101
101- bool elf:: isPPC64SmallCodeModelTocReloc (RelType type) {
102+ bool isPPC64SmallCodeModelTocReloc (RelType type) {
102103 // The only small code model relocations that access the .toc section.
103104 return type == R_PPC64_TOC16 || type == R_PPC64_TOC16_DS;
104105}
@@ -153,8 +154,8 @@ getRelaTocSymAndAddend(InputSectionBase *tocSec, uint64_t offset) {
153154// ld/lwa 3, 0(3) # load the value from the address
154155//
155156// Returns true if the relaxation is performed.
156- bool elf:: tryRelaxPPC64TocIndirection (RelType type, const Relocation &rel,
157- uint8_t *bufLoc) {
157+ bool tryRelaxPPC64TocIndirection (RelType type, const Relocation &rel,
158+ uint8_t *bufLoc) {
158159 assert (config->tocOptimize );
159160 if (rel.addend < 0 )
160161 return false ;
@@ -458,7 +459,7 @@ void PPC64::relaxTlsLdToLe(uint8_t *loc, RelType type, uint64_t val) const {
458459 }
459460}
460461
461- unsigned elf:: getPPCDFormOp (unsigned secondaryOp) {
462+ unsigned getPPCDFormOp (unsigned secondaryOp) {
462463 switch (secondaryOp) {
463464 case LBZX:
464465 return LBZ;
@@ -1093,7 +1094,10 @@ bool PPC64::adjustPrologueForCrossSplitStack(uint8_t *loc, uint8_t *end,
10931094 return true ;
10941095}
10951096
1096- TargetInfo *elf:: getPPC64TargetInfo () {
1097+ TargetInfo *getPPC64TargetInfo () {
10971098 static PPC64 target;
10981099 return ⌖
10991100}
1101+
1102+ } // namespace elf
1103+ } // namespace lld
0 commit comments