Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | static unsigned getELFSectionFlags(SectionKind K) { | ||||
unsigned Flags = 0; | unsigned Flags = 0; | ||||
if (!K.isMetadata()) | if (!K.isMetadata()) | ||||
Flags |= ELF::SHF_ALLOC; | Flags |= ELF::SHF_ALLOC; | ||||
if (K.isText()) | if (K.isText()) | ||||
Flags |= ELF::SHF_EXECINSTR; | Flags |= ELF::SHF_EXECINSTR; | ||||
if (K.isExecuteOnly()) | |||||
Flags |= ELF::SHF_ARM_PURECODE; | |||||
if (K.isWriteable()) | if (K.isWriteable()) | ||||
Flags |= ELF::SHF_WRITE; | Flags |= ELF::SHF_WRITE; | ||||
if (K.isThreadLocal()) | if (K.isThreadLocal()) | ||||
Flags |= ELF::SHF_TLS; | Flags |= ELF::SHF_TLS; | ||||
if (K.isMergeableCString() || K.isMergeableConst()) | if (K.isMergeableCString() || K.isMergeableConst()) | ||||
Flags |= ELF::SHF_MERGE; | Flags |= ELF::SHF_MERGE; | ||||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | if (EmitUniqueSection && UniqueSectionNames) { | ||||
Name.push_back('.'); | Name.push_back('.'); | ||||
TM.getNameWithPrefix(Name, GO, Mang, true); | TM.getNameWithPrefix(Name, GO, Mang, true); | ||||
} | } | ||||
unsigned UniqueID = MCContext::GenericSectionID; | unsigned UniqueID = MCContext::GenericSectionID; | ||||
if (EmitUniqueSection && !UniqueSectionNames) { | if (EmitUniqueSection && !UniqueSectionNames) { | ||||
UniqueID = *NextUniqueID; | UniqueID = *NextUniqueID; | ||||
(*NextUniqueID)++; | (*NextUniqueID)++; | ||||
} | } | ||||
// Use 0 as the unique ID for execute-only text | |||||
rengolin: Does this mean there is only one pure section on each module? | |||||
Not Done ReplyInline ActionsYes, that's the intention. prakhar: Yes, that's the intention. | |||||
if (Kind.isExecuteOnly()) | |||||
UniqueID = 0; | |||||
return Ctx.getELFSection(Name, getELFSectionType(Name, Kind), Flags, | return Ctx.getELFSection(Name, getELFSectionType(Name, Kind), Flags, | ||||
EntrySize, Group, UniqueID); | EntrySize, Group, UniqueID); | ||||
} | } | ||||
MCSection *TargetLoweringObjectFileELF::SelectSectionForGlobal( | MCSection *TargetLoweringObjectFileELF::SelectSectionForGlobal( | ||||
const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { | const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { | ||||
unsigned Flags = getELFSectionFlags(Kind); | unsigned Flags = getELFSectionFlags(Kind); | ||||
▲ Show 20 Lines • Show All 826 Lines • Show Last 20 Lines |
Does this mean there is only one pure section on each module?