2020-04-02 11:54:05 -07: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-27 12:50:59 -07:00
|
|
|
#include <cstdint>
|
|
|
|
|
2022-08-07 10:37:49 -04:00
|
|
|
namespace lld::macho {
|
2020-04-02 11:54:05 -07:00
|
|
|
|
2021-01-08 18:47:40 -05:00
|
|
|
class OutputSection;
|
2021-03-14 15:35:27 -07:00
|
|
|
class InputSection;
|
|
|
|
class Symbol;
|
2021-01-08 18:47:40 -05:00
|
|
|
|
2020-04-27 12:50:59 -07:00
|
|
|
class LoadCommand {
|
|
|
|
public:
|
|
|
|
virtual ~LoadCommand() = default;
|
|
|
|
virtual uint32_t getSize() const = 0;
|
|
|
|
virtual void writeTo(uint8_t *buf) const = 0;
|
|
|
|
};
|
|
|
|
|
2021-04-02 18:46:18 -04:00
|
|
|
template <class LP> void writeResult();
|
2021-10-30 16:35:30 -07:00
|
|
|
void resetWriter();
|
2020-04-02 11:54:05 -07:00
|
|
|
|
2021-05-03 18:31:23 -04:00
|
|
|
void createSyntheticSections();
|
2020-04-21 13:37:57 -07:00
|
|
|
|
2021-03-14 15:35:27 -07: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-08 18:47:40 -05:00
|
|
|
extern OutputSection *firstTLVDataSection;
|
|
|
|
|
2022-08-07 10:37:49 -04:00
|
|
|
} // namespace lld::macho
|
2020-04-02 11:54:05 -07:00
|
|
|
|
|
|
|
#endif
|