- OS << "\t.section\t" << getName();
-
- // Handle the weird solaris syntax if desired.
- if (TAI.usesSunStyleELFSectionSwitchSyntax() &&
- !getKind().isMergeableConst() && !getKind().isMergeableCString()) {
- if (!getKind().isMetadata())
- OS << ",#alloc";
- if (getKind().isText())
- OS << ",#execinstr";
- if (getKind().isWriteable())
- OS << ",#write";
- if (getKind().isThreadLocal())
- OS << ",#tls";
- } else {
- OS << ",\"";
-
- if (!getKind().isMetadata())
- OS << 'a';
- if (getKind().isText())
- OS << 'x';
- if (getKind().isWriteable())
- OS << 'w';
- if (getKind().isMergeable1ByteCString() ||
- getKind().isMergeable2ByteCString() ||
- getKind().isMergeable4ByteCString() ||
- getKind().isMergeableConst4() ||
- getKind().isMergeableConst8() ||
- getKind().isMergeableConst16())
- OS << 'M';
- if (getKind().isMergeable1ByteCString() ||
- getKind().isMergeable2ByteCString() ||
- getKind().isMergeable4ByteCString())
- OS << 'S';
- if (getKind().isThreadLocal())
- OS << 'T';
-
- OS << "\",";
-
- // If comment string is '@', e.g. as on ARM - use '%' instead
- if (TAI.getCommentString()[0] == '@')
- OS << '%';
- else
- OS << '@';
-
- if (getKind().isBSS() || getKind().isThreadBSS())
- OS << "nobits";
- else
- OS << "progbits";
-
- if (getKind().isMergeable1ByteCString()) {
- OS << ",1";
- } else if (getKind().isMergeable2ByteCString()) {
- OS << ",2";
- } else if (getKind().isMergeable4ByteCString()) {
- OS << ",4";
- } else if (getKind().isMergeableConst4()) {
- OS << ",4";
- } else if (getKind().isMergeableConst8()) {
- OS << ",8";
- } else if (getKind().isMergeableConst16()) {
- OS << ",16";
- }
+ // If any of the directives is an align_to_end directive, the whole nested
+ // group is align_to_end. So don't downgrade from align_to_end to just locked.
+ if (BundleLockState != BundleLockedAlignToEnd) {
+ BundleLockState = NewState;