[all-commits] [llvm/llvm-project] ba9caf: [Arm] Fix parsing and emission of Tag_also_compati...

Lucas Duarte Prates via All-commits all-commits at lists.llvm.org
Mon Aug 1 05:28:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ba9caf91708abb052e22982d2665abb50e9759cb
      https://github.com/llvm/llvm-project/commit/ba9caf91708abb052e22982d2665abb50e9759cb
  Author: Lucas Prates <lucas.prates at arm.com>
  Date:   2022-08-01 (Mon, 01 Aug 2022)

  Changed paths:
    M llvm/include/llvm/Support/ARMBuildAttributes.h
    M llvm/lib/Support/ARMBuildAttrs.cpp
    M llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
    M llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
    M llvm/test/CodeGen/ARM/build-attributes-encoding.s
    M llvm/test/MC/ARM/directive-eabi_attribute.s

  Log Message:
  -----------
  [Arm] Fix parsing and emission of Tag_also_compatible_with eabi attribute

According to the ABI for the Arm Architecture, the value for the
Tag_also_compatible_with eabi attribute is represented by an NTBS entry.
This string value, in turn, is composed of a pair of tag+value encoded
in one of two formats:
- ULEB128: tag, ULEB128: value, 0.
- ULEB128: tag, NBTS: data.
(See [[ https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/addenda32/addenda32.rst#3373secondary-compatibility-tag | section 3.3.7.3 on the Addenda to, and Errata in, the ABI for the Arm Architecture ]].)

Currently the Arm assembly parser and streamer ignore the encoding of
the attribute's NTBS value, which can result in incorrect attributes
being emitted in both assembly and object file outputs.

This patch fixes these issues by properly handing the value's encoding.
An update to llvm-readobj to properly handle the attribute's value will be
covered by a separate patch.

Patch by Victor Campos and Lucas Prates.

Reviewed By: vhscampos

Differential Revision: https://reviews.llvm.org/D129500




More information about the All-commits mailing list