mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
[GOLD] Reduce size of class Symbol
On 64-bit targets there is a 32-bit hole in symbol->u_, and another due to symbol flags exceeding 32 bits. By splitting the union, the total size of the class reduces by one 64-bit word. * symtab.h (Symbol): Split u_ into u1_ and u2_. Adjust accessors to suit. Move plt_offset_ before got_offsets_. * symtab.cc (Symbol::init_fields): Adjust for union change. (Symbol::init_base_output_data): Likewise. (Symbol::init_base_output_segment): Likewise. (Symbol::allocate_base_common): Likewise. (Symbol::output_section): Likewise. (Symbol::set_output_section): Likewise. (Symbol::set_output_segment): Likewise. * resolve.cc (Symbol::override_base): Likewise. (Symbol::override_base_with_special): Likewise.
This commit is contained in:
@@ -92,9 +92,9 @@ Symbol::override_base(const elfcpp::Sym<size, big_endian>& sym,
|
||||
Object* object, const char* version)
|
||||
{
|
||||
gold_assert(this->source_ == FROM_OBJECT);
|
||||
this->u_.from_object.object = object;
|
||||
this->u1_.object = object;
|
||||
this->override_version(version);
|
||||
this->u_.from_object.shndx = st_shndx;
|
||||
this->u2_.shndx = st_shndx;
|
||||
this->is_ordinary_shndx_ = is_ordinary;
|
||||
// Don't override st_type from plugin placeholder symbols.
|
||||
if (object->pluginobj() == NULL)
|
||||
@@ -952,13 +952,10 @@ Symbol::override_base_with_special(const Symbol* from)
|
||||
switch (from->source_)
|
||||
{
|
||||
case FROM_OBJECT:
|
||||
this->u_.from_object = from->u_.from_object;
|
||||
break;
|
||||
case IN_OUTPUT_DATA:
|
||||
this->u_.in_output_data = from->u_.in_output_data;
|
||||
break;
|
||||
case IN_OUTPUT_SEGMENT:
|
||||
this->u_.in_output_segment = from->u_.in_output_segment;
|
||||
this->u1_ = from->u1_;
|
||||
this->u2_ = from->u2_;
|
||||
break;
|
||||
case IS_CONSTANT:
|
||||
case IS_UNDEFINED:
|
||||
|
||||
Reference in New Issue
Block a user