2020-04-03 02:54:05 +08:00
|
|
|
//===- Writer.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_MACHO_WRITER_H
|
|
|
|
#define LLD_MACHO_WRITER_H
|
|
|
|
|
2020-04-28 03:50:59 +08:00
|
|
|
#include <cstdint>
|
|
|
|
|
2020-04-03 02:54:05 +08:00
|
|
|
namespace lld {
|
|
|
|
namespace macho {
|
|
|
|
|
2021-01-09 07:47:40 +08:00
|
|
|
class OutputSection;
|
2021-03-15 06:35:27 +08:00
|
|
|
class InputSection;
|
|
|
|
class Symbol;
|
2021-01-09 07:47:40 +08:00
|
|
|
|
2020-04-28 03:50:59 +08:00
|
|
|
class LoadCommand {
|
|
|
|
public:
|
|
|
|
virtual ~LoadCommand() = default;
|
|
|
|
virtual uint32_t getSize() const = 0;
|
|
|
|
virtual void writeTo(uint8_t *buf) const = 0;
|
|
|
|
};
|
|
|
|
|
2021-04-03 06:46:18 +08:00
|
|
|
template <class LP> void writeResult();
|
2020-04-03 02:54:05 +08:00
|
|
|
|
2021-05-04 06:31:23 +08:00
|
|
|
void createSyntheticSections();
|
2020-04-22 04:37:57 +08:00
|
|
|
|
2021-03-15 06:35:27 +08:00
|
|
|
// Add bindings for symbols that need weak or non-lazy bindings.
|
|
|
|
void addNonLazyBindingEntries(const Symbol *, const InputSection *,
|
|
|
|
uint64_t offset, int64_t addend = 0);
|
|
|
|
|
2021-01-09 07:47:40 +08:00
|
|
|
extern OutputSection *firstTLVDataSection;
|
|
|
|
|
2020-04-03 02:54:05 +08:00
|
|
|
} // namespace macho
|
|
|
|
} // namespace lld
|
|
|
|
|
|
|
|
#endif
|