1//===-- ELFAttributes.h - ELF Attributes ------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_SUPPORT_ELFATTRIBUTES_H
10#define LLVM_SUPPORT_ELFATTRIBUTES_H
11
12#include "llvm/ADT/ArrayRef.h"
13#include "llvm/ADT/StringRef.h"
14
15namespace llvm {
16
17struct TagNameItem {
18 unsigned attr;
19 StringRef tagName;
20};
21
22using TagNameMap = ArrayRef<TagNameItem>;
23
24namespace ELFAttrs {
25
26enum AttrType : unsigned { File = 1, Section = 2, Symbol = 3 };
27
28StringRef attrTypeAsString(unsigned attr, TagNameMap tagNameMap,
29 bool hasTagPrefix = true);
30Optional<unsigned> attrTypeFromString(StringRef tag, TagNameMap tagNameMap);
31
32// Magic numbers for ELF attributes.
33enum AttrMagic { Format_Version = 0x41 };
34
35} // namespace ELFAttrs
36} // namespace llvm
37#endif
38

source code of llvm/include/llvm/Support/ELFAttributes.h