uint32_t _ordinal;
};
-/// \brief Simple atom created by the GOT pass.
-class TestingGOTAtom : public DefinedAtom {
-public:
- TestingGOTAtom(const File &F, const Atom &) : _file(F) {
- static uint32_t lastOrdinal = 0;
- _ordinal = lastOrdinal++;
- }
-
- const File &file() const override { return _file; }
-
- StringRef name() const override { return StringRef(); }
-
- uint64_t ordinal() const override { return _ordinal; }
-
- uint64_t size() const override { return 0; }
-
- Scope scope() const override { return DefinedAtom::scopeLinkageUnit; }
-
- Interposable interposable() const override { return DefinedAtom::interposeNo; }
-
- Merge merge() const override { return DefinedAtom::mergeNo; }
-
- ContentType contentType() const override { return DefinedAtom::typeGOT; }
-
- Alignment alignment() const override { return 8; }
-
- SectionChoice sectionChoice() const override {
- return DefinedAtom::sectionBasedOnContent;
- }
-
- StringRef customSectionName() const override { return StringRef(); }
-
- DeadStripKind deadStrip() const override {
- return DefinedAtom::deadStripNormal;
- }
-
- ContentPermissions permissions() const override {
- return DefinedAtom::permRW_;
- }
-
- ArrayRef<uint8_t> rawContent() const override { return ArrayRef<uint8_t>(); }
-
- reference_iterator begin() const override {
- return reference_iterator(*this, nullptr);
- }
-
- reference_iterator end() const override {
- return reference_iterator(*this, nullptr);
- }
-
- const Reference *derefIterator(const void *iter) const override {
- return nullptr;
- }
-
- void incrementIterator(const void *&iter) const override {}
-
-private:
- const File &_file;
- uint32_t _ordinal;
-};
-
class OrderPass : public Pass {
public:
/// Sorts atoms by position