Revert "Revert "Fix symbol lookup order during relocation""
This reverts commit f947be2889639defc6424b1813ccc779528b7598.
diff --git a/linker/linked_list.h b/linker/linked_list.h
index 72a32b4..b088061 100644
--- a/linker/linked_list.h
+++ b/linker/linked_list.h
@@ -36,6 +36,12 @@
clear();
}
+ LinkedList(LinkedList&& that) {
+ this->head_ = that.head_;
+ this->tail_ = that.tail_;
+ that.head_ = that.tail_ = nullptr;
+ }
+
void push_front(T* const element) {
LinkedListEntry<T>* new_entry = Allocator::alloc();
new_entry->next = head_;
@@ -140,6 +146,12 @@
return false;
}
+ static LinkedList make_list(T* const element) {
+ LinkedList<T, Allocator> one_element_list;
+ one_element_list.push_back(element);
+ return one_element_list;
+ }
+
private:
LinkedListEntry<T>* head_;
LinkedListEntry<T>* tail_;