[all-commits] [llvm/llvm-project] 26475f: [AArch64] Refactor @plt, @gotpcrel, and @AUTH to u...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Apr 8 09:09:42 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 26475f5bdd2f4a042b63fdf1ee62d6634872dee5
      https://github.com/llvm/llvm-project/commit/26475f5bdd2f4a042b63fdf1ee62d6634872dee5
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-04-08 (Tue, 08 Apr 2025)

  Changed paths:
    M llvm/include/llvm/MC/MCParser/MCAsmParser.h
    M llvm/lib/MC/MCParser/AsmParser.cpp
    M llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
    M llvm/test/MC/AArch64/data-directive-specifier.s
    M llvm/test/MC/AArch64/elf-reloc-ptrauth.s
    M llvm/test/MC/AArch64/label-arithmetic-diags-darwin.s

  Log Message:
  -----------
  [AArch64] Refactor @plt, @gotpcrel, and @AUTH to use parseDataExpr

Following PR #132569 (RISC-V), which added `parseDataExpr` for parsing
expressions in data directives (e.g., `.word`), this PR migrates AArch64
`@plt`, `@gotpcrel`, and `@AUTH` from the `parsePrimaryExpr` workaround
to `parseDataExpr`. The goal is to align with the GNU assembler model,
where relocation specifiers apply to the entire operand rather than
individual terms, reducing complexity-especially evident in `@AUTH`
parsing.

Note: AArch64 ELF lacks an official syntax for data directives
(#132570). A prefix notation might be a preferable future direction.
I recommend `%specifier(expr)`.

AsmParser's `@specifier` parsing is suboptimal, necessitating lexer
workarounds. `@` might appear multiple times in an operand.
We should not use `@` beyond the existing AArch64 Mach-O instruction
operands.

In the test elf-reloc-ptrauth.s, many errors are now reported at parse
time.

Pull Request: https://github.com/llvm/llvm-project/pull/134202



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list