summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/StubAtoms.hpp
blob: ae0707f78357187a0515e5c5fd00ba523a40ead6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//===- lib/ReaderWriter/MachO/StubAtoms.hpp -------------------------------===//
//
//                             The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLD_READER_WRITER_MACHO_STUB_ATOMS_H
#define LLD_READER_WRITER_MACHO_STUB_ATOMS_H

#include "llvm/ADT/ArrayRef.h"

#include "lld/Core/DefinedAtom.h"
#include "lld/Core/SharedLibraryAtom.h"
#include "lld/Core/File.h"
#include "lld/Core/Reference.h"
#include "lld/ReaderWriter/Simple.h"

#include "ReferenceKinds.h"
#include "StubAtoms_x86_64.hpp"
#include "StubAtoms_x86.hpp"

namespace lld {
namespace mach_o {


//
// StubBinderAtom created by the stubs pass.
//
class StubBinderAtom : public SharedLibraryAtom {
public:
  StubBinderAtom(const File &f) : _file(f) { 
  }
          
  virtual const File& file() const {
    return _file;
  }

  virtual StringRef name() const {
    return StringRef("dyld_stub_binder");
  }

  virtual StringRef loadName() const {
    return StringRef("/usr/lib/libSystem.B.dylib");
  }
  
  virtual bool canBeNullAtRuntime() const {
    return false;
  }

  virtual Type type() const {
    return Type::Unknown;
  }

  virtual uint64_t size() const LLVM_OVERRIDE {
    return 0;
  }
  
private:
  const File  &_file;
};



} // namespace mach_o 
} // namespace lld 


#endif // LLD_READER_WRITER_MACHO_STUB_ATOMS_H
OpenPOWER on IntegriCloud