From a90b9fca6fba5bc11b0480372e35368b8ff5eb77 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 4 Oct 2001 12:30:26 +0000 Subject: [PATCH] * elf-bfd.h (struct elf_link_hash_entry): Reorganise for better packing. --- bfd/ChangeLog | 3 +++ bfd/elf-bfd.h | 52 +++++++++++++++++++++++++-------------------------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1108a5eed2e..1f058878cec 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,8 @@ 2001-10-04 Alan Modra + * elf-bfd.h (struct elf_link_hash_entry): Reorganise for better + packing. + * elf32-mips.c (mips_elf_record_global_got_symbol): Set got.offset to 1 rather than 0 to avoid confusing copy_indirect_symbol. (mips_elf_sort_hash_table_f): Compare got.offset against 1. diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 8ab13b7519b..5b2da987769 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -89,9 +89,6 @@ struct elf_link_hash_entry set to -2 if the symbol is used by a reloc. */ long indx; - /* Symbol size. */ - bfd_size_type size; - /* Symbol index as a dynamic symbol. Initialized to -1, and remains -1 if this is not a dynamic symbol. */ /* ??? Note that this is consistently used as a synonym for tests @@ -109,31 +106,14 @@ struct elf_link_hash_entry /* String table index in .dynstr if this is a dynamic symbol. */ unsigned long dynstr_index; + /* Hash value of the name computed using the ELF hash function. */ + unsigned long elf_hash_value; + /* If this is a weak defined symbol from a dynamic object, this field points to a defined symbol with the same value, if there is one. Otherwise it is NULL. */ struct elf_link_hash_entry *weakdef; - /* If this symbol requires an entry in the global offset table, the - processor specific backend uses this field to track usage and - final offset. We use a union and two names primarily to document - the intent of any particular piece of code. The field should be - used as a count until size_dynamic_sections, at which point the - contents of the .got is fixed. Afterward, if this field is -1, - then the symbol does not require a global offset table entry. */ - union - { - bfd_signed_vma refcount; - bfd_vma offset; - } got; - - /* Same, but tracks a procedure linkage table entry. */ - union - { - bfd_signed_vma refcount; - bfd_vma offset; - } plt; - /* If this symbol is used in the linker created sections, the processor specific backend uses this field to map the field into the offset from the beginning of the section. */ @@ -162,15 +142,35 @@ struct elf_link_hash_entry /* Virtual table derivation info. */ struct elf_link_hash_entry *vtable_parent; + /* If this symbol requires an entry in the global offset table, the + processor specific backend uses this field to track usage and + final offset. We use a union and two names primarily to document + the intent of any particular piece of code. The field should be + used as a count until size_dynamic_sections, at which point the + contents of the .got is fixed. Afterward, if this field is -1, + then the symbol does not require a global offset table entry. */ + union + { + bfd_signed_vma refcount; + bfd_vma offset; + } got; + + /* Same, but tracks a procedure linkage table entry. */ + union + { + bfd_signed_vma refcount; + bfd_vma offset; + } plt; + + /* Symbol size. */ + bfd_size_type size; + /* Symbol type (STT_NOTYPE, STT_OBJECT, etc.). */ char type; /* Symbol st_other value, symbol visibility. */ unsigned char other; - /* Hash value of the name computed using the ELF hash function. */ - unsigned long elf_hash_value; - /* Some flags; legal values follow. */ unsigned short elf_link_hash_flags; /* Symbol is referenced by a non-shared object. */ -- 2.30.2