[PATCH] D69296: [ARM] Uses "Sun Style" syntax for section switching

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 02:39:58 PDT 2019


peter.smith added a comment.

I can see that this would allow "Sun Style" syntax for section switching that seems to be permitted for the Arm target. The question is why, and why just Arm? Looking at the GNU as code it looks like:

- This syntax was supported for Solaris, it only has tests for Solaris
- The syntax isn't gated by target, but it doesn't work on any target that uses # as the comment character (x86), it fails with a cryptic error message, this suggests it works on Arm and AArch64 by accident rather than by intention.
- The comment in MCAsmInfo.h states "instead of the normal ELF syntax", looking at the implementation it seems like both can be used at once as there isn't a parsing difference, however this might not be by design.

  /// This is true if this target uses "Sun Style" syntax for section switching
  /// ("#alloc,#write" etc) instead of the normal ELF syntax (,"a,w") in
  /// .section directives.  Defaults to false.
  bool SunStyleELFSectionSwitchSyntax = false;

So at the moment, I'm not convinced that doing this just for Arm and leaving the existing comment in MCAsmInfo.h in place is the right thing to do. If this is being done to be compatible with GNU, and for a good reason,  then it should work on all targets that it works in GNU as and not just Arm.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69296/new/

https://reviews.llvm.org/D69296





More information about the llvm-commits mailing list