LLVM 23.0.0git
ELFWriter.h
Go to the documentation of this file.
1//===- llvm/DWP/ELFWriter.h - ELF structure writer -----*- 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// Shared utilities for writing ELF header and section header structures.
10// Used by both the MC ELFObjectWriter and the DWP direct ELF writer.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_DWP_ELFWRITER_H
15#define LLVM_DWP_ELFWRITER_H
16
18#include <cstdint>
19
20namespace llvm {
21namespace ELF {
22
23/// Write an ELF file header (Elf32_Ehdr or Elf64_Ehdr) for an ET_REL object.
24void writeHeader(support::endian::Writer &W, bool Is64Bit, uint8_t OSABI,
25 uint8_t ABIVersion, uint16_t EMachine, uint32_t EFlags,
26 uint64_t SHOff, uint16_t SHNum, uint16_t SHStrNdx);
27
28/// Write a single ELF section header entry (Elf32_Shdr or Elf64_Shdr).
29void writeSectionHeader(support::endian::Writer &W, bool Is64Bit, uint32_t Name,
30 uint32_t Type, uint64_t Flags, uint64_t Address,
31 uint64_t Offset, uint64_t Size, uint32_t Link,
32 uint32_t Info, uint64_t Alignment, uint64_t EntrySize);
33
34} // namespace ELF
35} // namespace llvm
36
37#endif // LLVM_DWP_ELFWRITER_H
void writeHeader(support::endian::Writer &W, bool Is64Bit, uint8_t OSABI, uint8_t ABIVersion, uint16_t EMachine, uint32_t EFlags, uint64_t SHOff, uint16_t SHNum, uint16_t SHStrNdx)
Write an ELF file header (Elf32_Ehdr or Elf64_Ehdr) for an ET_REL object.
Definition ELFWriter.cpp:21
void writeSectionHeader(support::endian::Writer &W, bool Is64Bit, uint32_t Name, uint32_t Type, uint64_t Flags, uint64_t Address, uint64_t Offset, uint64_t Size, uint32_t Link, uint32_t Info, uint64_t Alignment, uint64_t EntrySize)
Write a single ELF section header entry (Elf32_Shdr or Elf64_Shdr).
Definition ELFWriter.cpp:48
This is an optimization pass for GlobalISel generic memory operations.
@ Offset
Definition DWP.cpp:557