This is an archive of the discontinued LLVM Phabricator instance.

[Arm] Fix parsing and emission of Tag_also_compatible_with eabi attribute
ClosedPublic

Authored by pratlucas on Jul 11 2022, 9:50 AM.

Details

Summary

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 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.

Diff Detail

Event Timeline

pratlucas created this revision.Jul 11 2022, 9:50 AM
pratlucas requested review of this revision.Jul 11 2022, 9:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2022, 9:50 AM
pratlucas updated this revision to Diff 443676.Jul 11 2022, 9:52 AM

Minor update to include order.

pratlucas edited the summary of this revision. (Show Details)Jul 11 2022, 10:03 AM
pratlucas added reviewers: vhscampos, compnerd, stuij, asl.
vhscampos requested changes to this revision.Jul 12 2022, 2:15 AM

A couple of typos in the commit message:

"streamerignore"
"enconding" (twice)

This revision now requires changes to proceed.Jul 12 2022, 2:15 AM
pratlucas edited the summary of this revision. (Show Details)Jul 12 2022, 2:26 AM

Updated commit message to fix typos.

vhscampos accepted this revision.Jul 15 2022, 3:40 AM

LGTM. Please wait one week or so for any other comment.

This revision is now accepted and ready to land.Jul 15 2022, 3:40 AM
This revision was landed with ongoing or failed builds.Aug 1 2022, 5:28 AM
This revision was automatically updated to reflect the committed changes.