llvm/lld/ELF/OutputSections.h

//===- OutputSections.h -----------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLD_ELF_OUTPUT_SECTIONS_H
#define LLD_ELF_OUTPUT_SECTIONS_H

#include "InputSection.h"
#include "LinkerScript.h"
#include "lld/Common/LLVM.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Parallel.h"

#include <array>

namespace lld::elf {

struct PhdrEntry;

struct CompressedData {};

// This represents a section in an output file.
// It is composed of multiple InputSections.
// The writer creates multiple OutputSections and assign them unique,
// non-overlapping file offsets and VAs.
class OutputSection final : public SectionBase {};

struct OutputDesc final : SectionCommand {};

// This represents a CLASS(class_name) { ... } that can be referenced by output
// section descriptions. If referenced more than once, the sections can be
// spilled to the next reference like --enable-non-contiguous-regions.
struct SectionClass final : public SectionBase {};

struct SectionClassDesc : SectionCommand {};

int getPriority(StringRef s);

InputSection *getFirstInputSection(const OutputSection *os);
llvm::ArrayRef<InputSection *>
getInputSections(const OutputSection &os,
                 SmallVector<InputSection *, 0> &storage);

uint64_t getHeaderSize(Ctx &);
} // namespace lld::elf

#endif