Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:29

0001 //===-- ELFAttributes.h - ELF Attributes ------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_SUPPORT_ELFATTRIBUTES_H
0010 #define LLVM_SUPPORT_ELFATTRIBUTES_H
0011 
0012 #include "llvm/ADT/ArrayRef.h"
0013 #include "llvm/ADT/StringRef.h"
0014 #include <optional>
0015 
0016 namespace llvm {
0017 
0018 struct TagNameItem {
0019   unsigned attr;
0020   StringRef tagName;
0021 };
0022 
0023 using TagNameMap = ArrayRef<TagNameItem>;
0024 
0025 namespace ELFAttrs {
0026 
0027 enum AttrType : unsigned { File = 1, Section = 2, Symbol = 3 };
0028 
0029 StringRef attrTypeAsString(unsigned attr, TagNameMap tagNameMap,
0030                            bool hasTagPrefix = true);
0031 std::optional<unsigned> attrTypeFromString(StringRef tag, TagNameMap tagNameMap);
0032 
0033 // Magic numbers for ELF attributes.
0034 enum AttrMagic { Format_Version = 0x41 };
0035 
0036 } // namespace ELFAttrs
0037 } // namespace llvm
0038 #endif