[all-commits] [llvm/llvm-project] 7620f0: [MC] Parse SHF_LINK_ORDER argument before section ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Jan 9 10:42:48 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7620f03ef7a662384d67b6bd1fad8582dfe9dd82
      https://github.com/llvm/llvm-project/commit/7620f03ef7a662384d67b6bd1fad8582dfe9dd82
  Author: Fangrui Song <i at maskray.me>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    M llvm/lib/MC/MCParser/ELFAsmParser.cpp
    M llvm/lib/MC/MCSectionELF.cpp
    M llvm/test/CodeGen/AArch64/patchable-function-entry.ll
    M llvm/test/CodeGen/LoongArch/patchable-function-entry.ll
    M llvm/test/CodeGen/Mips/xray-section-group.ll
    M llvm/test/CodeGen/RISCV/patchable-function-entry.ll
    M llvm/test/CodeGen/X86/basic-block-sections-labels-functions-sections.ll
    M llvm/test/CodeGen/X86/gcc_except_table-multi.ll
    M llvm/test/CodeGen/X86/patchable-function-entry.ll
    M llvm/test/CodeGen/X86/stack-size-section-function-sections.ll
    M llvm/test/CodeGen/X86/stack-size-section.ll
    M llvm/test/CodeGen/X86/xray-section-group.ll
    M llvm/test/MC/ELF/section-combine.s
    M llvm/test/MC/ELF/section.s

  Log Message:
  -----------
  [MC] Parse SHF_LINK_ORDER argument before section group name (#77407)

When both SHF_LINK_ORDER | SHF_GROUP flags are set, GNU assembler from
2.35 onwards (https://sourceware.org/PR25381
https://sourceware.org/binutils/docs/as/Section.html) parses the
SHF_LINK_ORDER argument before section group name, different from us.

This is unfortunate, but does not matter because the `.section` flag `o`
is a niche feature only used by compiler instrumentations, not adopted
by hand-written assembly, and using both flags is extremely rare. Let's
just match GNU assembler. There is another benefit: we now support
zero-flag section group with the SHF_LINK_ORDER flag, while previously
there isn't a syntax.

While here, print 'G' after 'o' to be clear that the 'G' argument is
parsed after the 'o' argument. To make the diff smaller, we don't print
'G' after 'w' in the absence of 'o' for now.




More information about the All-commits mailing list