Index: ELF/SyntheticSections.cpp =================================================================== --- ELF/SyntheticSections.cpp +++ ELF/SyntheticSections.cpp @@ -1999,6 +1999,9 @@ ESym->setVisibility(Sym->Visibility); } + if (Config->EMachine == EM_PPC64) + ESym->st_other |= getPPC64GlobalEntryToLocalEntryBits(Sym->StOther); + ESym->st_name = Ent.StrTabOffset; ESym->st_shndx = getSymSectionIndex(Ent.Sym); Index: ELF/Target.h =================================================================== --- ELF/Target.h +++ ELF/Target.h @@ -177,6 +177,12 @@ // to the local entry-point. unsigned getPPC64GlobalEntryToLocalEntryOffset(uint8_t StOther); +// Return only the StOther bits used to encode PPC64 +// GlobalEntryToLocalEntry offset. +static inline uint8_t getPPC64GlobalEntryToLocalEntryBits(uint8_t StOther) { + return StOther & 0xE0; +} + uint64_t getPPC64TocBase(); uint64_t getAArch64Page(uint64_t Expr);