2009-02-27 Ian Lance Taylor <iant@google.com>
+ PR 5990
+ * descriptors.h (Open_descriptor): Add is_on_stack field.
+ * descriptors.cc (Descriptors::open): If the descriptor is on the
+ top of the stack, remove it. Initialize is_on_stack field.
+ (Descriptors::release): Only add pod to stack if it is not on the
+ stack already.
+ (Descriptors::close_some_descriptor): Clear stack_next and
+ is_on_stack fields.
+
PR 7091
* output.cc (Output_section::find_starting_output_address): Rename
from starting_output_address; add PADDR parameter; change return
{
gold_assert(!pod->inuse);
pod->inuse = true;
+ if (descriptor == this->stack_top_)
+ {
+ this->stack_top_ = pod->stack_next;
+ pod->stack_next = -1;
+ pod->is_on_stack = false;
+ }
return descriptor;
}
}
pod->stack_next = -1;
pod->inuse = true;
pod->is_write = (flags & O_ACCMODE) != O_RDONLY;
+ pod->is_on_stack = false;
++this->current_;
if (this->current_ >= this->limit_)
else
{
pod->inuse = false;
- if (!pod->is_write)
+ if (!pod->is_write && !pod->is_on_stack)
{
pod->stack_next = this->stack_top_;
this->stack_top_ = descriptor;
+ pod->is_on_stack = true;
}
}
}
this->stack_top_ = pod->stack_next;
else
this->open_descriptors_[last].stack_next = pod->stack_next;
+ pod->stack_next = -1;
+ pod->is_on_stack = false;
return true;
}
last = i;