Skip to content

Commit

Permalink
[llvm-readobj][AArch64][ELF][PAC] Support `GNU_PROPERTY_AARCH64_FEATU…
Browse files Browse the repository at this point in the history
…RE_PAUTH`

This adds support for `GNU_PROPERTY_AARCH64_FEATURE_PAUTH` feature
handling in llvm-readobj and llvm-readelf. The following constants for
supported platforms are also introduced:

- `GNU_PROPERTY_AARCH64_FEATURE_PAUTH_PLATFORM_INVALID = 0`
- `GNU_PROPERTY_AARCH64_FEATURE_PAUTH_PLATFORM_BAREMETAL = 1`
- `GNU_PROPERTY_AARCH64_FEATURE_PAUTH_PLATFORM_LINUX = 2`

For the linux platform, output of the tools contains descriptions of
PAuth features which are enabled/disabled depending on the version
value.
  • Loading branch information
kovdan01 committed Feb 16, 2024
1 parent a34910a commit c8d71df
Show file tree
Hide file tree
Showing 4 changed files with 381 additions and 89 deletions.
8 changes: 8 additions & 0 deletions llvm/include/llvm/BinaryFormat/ELF.h
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,7 @@ enum : unsigned {
GNU_PROPERTY_STACK_SIZE = 1,
GNU_PROPERTY_NO_COPY_ON_PROTECTED = 2,
GNU_PROPERTY_AARCH64_FEATURE_1_AND = 0xc0000000,
GNU_PROPERTY_AARCH64_FEATURE_PAUTH = 0xc0000001,
GNU_PROPERTY_X86_FEATURE_1_AND = 0xc0000002,

GNU_PROPERTY_X86_UINT32_OR_LO = 0xc0008000,
Expand All @@ -1690,6 +1691,13 @@ enum : unsigned {
GNU_PROPERTY_AARCH64_FEATURE_1_PAC = 1 << 1,
};

// aarch64 PAuth platforms
enum : unsigned {
GNU_PROPERTY_AARCH64_FEATURE_PAUTH_PLATFORM_INVALID = 0,
GNU_PROPERTY_AARCH64_FEATURE_PAUTH_PLATFORM_BAREMETAL = 1,
GNU_PROPERTY_AARCH64_FEATURE_PAUTH_PLATFORM_LINUX = 2,
};

// x86 processor feature bits.
enum : unsigned {
GNU_PROPERTY_X86_FEATURE_1_IBT = 1 << 0,
Expand Down
Loading

0 comments on commit c8d71df

Please sign in to comment.