[all-commits] [llvm/llvm-project] cb1d6e: Reland: [ELFAttributeParser] Skip unknown vendor s...

Simon Tatham via All-commits all-commits at lists.llvm.org
Tue Jun 27 08:42:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cb1d6ea8cff7cbfc4218f91d1bd81544a44a61d4
      https://github.com/llvm/llvm-project/commit/cb1d6ea8cff7cbfc4218f91d1bd81544a44a61d4
  Author: Simon Tatham <simon.tatham at arm.com>
  Date:   2023-06-27 (Tue, 27 Jun 2023)

  Changed paths:
    M lld/test/ELF/arm-tag-vfp-args-errs.s
    M llvm/lib/Support/ELFAttributeParser.cpp

  Log Message:
  -----------
  Reland: [ELFAttributeParser] Skip unknown vendor subsections.

An .ARM.attributes section is divided into subsections, each labelled
with a vendor name. There is one standardised vendor name, which must
be used for all attributes that affect compatibility. Subsections
labelled with other vendor names can be used for optimisation
purposes, but it has to be safe for an object file consumer to ignore
them if it doesn't recognise the vendor name.

LLD currently terminates parsing of the whole attributes section as
soon as it encounters a subsection with a vendor name it doesn't
recognise (which is anything other than the standard one). This can
prevent it from detecting compatibility issues, if a standard
subsection followed the vendor-specific one.

This patch modifies the attribute parser so that unrecognised vendor
subsections are silently skipped, and the subsections beyond them are
still processed.

(Relanded with no change from the original commit 8f208edd44d0832. I
reverted it in 949bb7e4de62cd0 due to widespread buildbot breakage,
failing to notice that 975f71faa72aaaa had already fixed the failing
unit test. Also, the *revert* caused at least one buildbot to fail,
because I switched the affected lld test to making %t a directory, and
then the reverted version tried to treat it as a file without cleaning
the output directory first.)

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




More information about the All-commits mailing list