GNU Binutils with patches for OS216
Révision | d2149d727fa0cc33a0cd4a8eee78b9fe4108bede (tree) |
---|---|
l'heure | 2009-06-17 02:45:08 |
Auteur | H.J. Lu <hjl.tools@gmai...> |
Commiter | H.J. Lu |
2009-06-16 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (ELF_LOCAL_SYMBOL_HASH): New.
* elf32-i386.c (elf_i386_local_hash): Removed.
(elf_i386_local_htab_hash): Use ELF_LOCAL_SYMBOL_HASH.
(elf_i386_get_local_sym_hash): Likewise.
* elf64-x86-64.c (elf64_x86_64_local_hash): Removed.
(elf64_x86_64_local_htab_hash): Use ELF_LOCAL_SYMBOL_HASH.
(elf64_x86_64_get_local_sym_hash): Likewise.
* elfxx-ia64.c (elfNN_ia64_local_htab_hash): Likewise.
(get_local_sym_hash): Likewise.
@@ -1,5 +1,19 @@ | ||
1 | 1 | 2009-06-16 H.J. Lu <hongjiu.lu@intel.com> |
2 | 2 | |
3 | + * elf-bfd.h (ELF_LOCAL_SYMBOL_HASH): New. | |
4 | + | |
5 | + * elf32-i386.c (elf_i386_local_hash): Removed. | |
6 | + (elf_i386_local_htab_hash): Use ELF_LOCAL_SYMBOL_HASH. | |
7 | + (elf_i386_get_local_sym_hash): Likewise. | |
8 | + | |
9 | + * elf64-x86-64.c (elf64_x86_64_local_hash): Removed. | |
10 | + (elf64_x86_64_local_htab_hash): Use ELF_LOCAL_SYMBOL_HASH. | |
11 | + (elf64_x86_64_get_local_sym_hash): Likewise. | |
12 | + * elfxx-ia64.c (elfNN_ia64_local_htab_hash): Likewise. | |
13 | + (get_local_sym_hash): Likewise. | |
14 | + | |
15 | +2009-06-16 H.J. Lu <hongjiu.lu@intel.com> | |
16 | + | |
3 | 17 | * elfxx-ia64.c (elfNN_ia64_link_hash_table): Remove got_sec, |
4 | 18 | rel_got_sec and plt_sec. |
5 | 19 | (elfNN_ia64_relax_section): Updated. |
@@ -2163,6 +2163,12 @@ extern bfd_boolean _bfd_elf_create_ifunc_sections | ||
2163 | 2163 | /* Large common section. */ |
2164 | 2164 | extern asection _bfd_elf_large_com_section; |
2165 | 2165 | |
2166 | +/* Hash for local symbol with the first section id, ID, in the input | |
2167 | + file and the local symbol index, SYM. */ | |
2168 | +#define ELF_LOCAL_SYMBOL_HASH(ID, SYM) \ | |
2169 | + (((((ID) & 0xff) << 24) | (((ID) & 0xff00) << 8)) \ | |
2170 | + ^ (SYM) ^ ((ID) >> 16)) | |
2171 | + | |
2166 | 2172 | /* This is the condition under which finish_dynamic_symbol will be called. |
2167 | 2173 | If our finish_dynamic_symbol isn't called, we'll need to do something |
2168 | 2174 | about initializing any .plt and .got entries in relocate_section. */ |
@@ -745,13 +745,6 @@ elf_i386_link_hash_newfunc (struct bfd_hash_entry *entry, | ||
745 | 745 | return entry; |
746 | 746 | } |
747 | 747 | |
748 | -static hashval_t | |
749 | -elf_i386_local_hash (int id, int r_sym) | |
750 | -{ | |
751 | - return ((((id & 0xff) << 24) | ((id & 0xff00) << 8)) | |
752 | - ^ r_sym ^ (id >> 16)); | |
753 | -} | |
754 | - | |
755 | 748 | /* Compute a hash of a local hash entry. We use elf_link_hash_entry |
756 | 749 | for local symbol so that we can handle local STT_GNU_IFUNC symbols |
757 | 750 | as global symbol. We reuse indx and dynstr_index for local symbol |
@@ -762,7 +755,7 @@ elf_i386_local_htab_hash (const void *ptr) | ||
762 | 755 | { |
763 | 756 | struct elf_link_hash_entry *h |
764 | 757 | = (struct elf_link_hash_entry *) ptr; |
765 | - return elf_i386_local_hash (h->indx, h->dynstr_index); | |
758 | + return ELF_LOCAL_SYMBOL_HASH (h->indx, h->dynstr_index); | |
766 | 759 | } |
767 | 760 | |
768 | 761 | /* Compare local hash entries. */ |
@@ -787,8 +780,8 @@ elf_i386_get_local_sym_hash (struct elf_i386_link_hash_table *htab, | ||
787 | 780 | { |
788 | 781 | struct elf_i386_link_hash_entry e, *ret; |
789 | 782 | asection *sec = abfd->sections; |
790 | - hashval_t h = elf_i386_local_hash (sec->id, | |
791 | - ELF32_R_SYM (rel->r_info)); | |
783 | + hashval_t h = ELF_LOCAL_SYMBOL_HASH (sec->id, | |
784 | + ELF32_R_SYM (rel->r_info)); | |
792 | 785 | void **slot; |
793 | 786 | |
794 | 787 | e.elf.indx = sec->id; |
@@ -559,13 +559,6 @@ elf64_x86_64_link_hash_newfunc (struct bfd_hash_entry *entry, | ||
559 | 559 | return entry; |
560 | 560 | } |
561 | 561 | |
562 | -static hashval_t | |
563 | -elf64_x86_64_local_hash (int id, int r_sym) | |
564 | -{ | |
565 | - return ((((id & 0xff) << 24) | ((id & 0xff00) << 8)) | |
566 | - ^ r_sym ^ (id >> 16)); | |
567 | -} | |
568 | - | |
569 | 562 | /* Compute a hash of a local hash entry. We use elf_link_hash_entry |
570 | 563 | for local symbol so that we can handle local STT_GNU_IFUNC symbols |
571 | 564 | as global symbol. We reuse indx and dynstr_index for local symbol |
@@ -576,7 +569,7 @@ elf64_x86_64_local_htab_hash (const void *ptr) | ||
576 | 569 | { |
577 | 570 | struct elf_link_hash_entry *h |
578 | 571 | = (struct elf_link_hash_entry *) ptr; |
579 | - return elf64_x86_64_local_hash (h->indx, h->dynstr_index); | |
572 | + return ELF_LOCAL_SYMBOL_HASH (h->indx, h->dynstr_index); | |
580 | 573 | } |
581 | 574 | |
582 | 575 | /* Compare local hash entries. */ |
@@ -601,8 +594,8 @@ elf64_x86_64_get_local_sym_hash (struct elf64_x86_64_link_hash_table *htab, | ||
601 | 594 | { |
602 | 595 | struct elf64_x86_64_link_hash_entry e, *ret; |
603 | 596 | asection *sec = abfd->sections; |
604 | - hashval_t h = elf64_x86_64_local_hash (sec->id, | |
605 | - ELF64_R_SYM (rel->r_info)); | |
597 | + hashval_t h = ELF_LOCAL_SYMBOL_HASH (sec->id, | |
598 | + ELF64_R_SYM (rel->r_info)); | |
606 | 599 | void **slot; |
607 | 600 | |
608 | 601 | e.elf.indx = sec->id; |
@@ -1809,8 +1809,7 @@ elfNN_ia64_local_htab_hash (const void *ptr) | ||
1809 | 1809 | struct elfNN_ia64_local_hash_entry *entry |
1810 | 1810 | = (struct elfNN_ia64_local_hash_entry *) ptr; |
1811 | 1811 | |
1812 | - return (((entry->id & 0xff) << 24) | ((entry->id & 0xff00) << 8)) | |
1813 | - ^ entry->r_sym ^ (entry->id >> 16); | |
1812 | + return ELF_LOCAL_SYMBOL_HASH (entry->id, entry->r_sym); | |
1814 | 1813 | } |
1815 | 1814 | |
1816 | 1815 | /* Compare local hash entries. */ |
@@ -2033,8 +2032,8 @@ get_local_sym_hash (struct elfNN_ia64_link_hash_table *ia64_info, | ||
2033 | 2032 | { |
2034 | 2033 | struct elfNN_ia64_local_hash_entry e, *ret; |
2035 | 2034 | asection *sec = abfd->sections; |
2036 | - hashval_t h = (((sec->id & 0xff) << 24) | ((sec->id & 0xff00) << 8)) | |
2037 | - ^ ELFNN_R_SYM (rel->r_info) ^ (sec->id >> 16); | |
2035 | + hashval_t h = ELF_LOCAL_SYMBOL_HASH (sec->id, | |
2036 | + ELFNN_R_SYM (rel->r_info)); | |
2038 | 2037 | void **slot; |
2039 | 2038 | |
2040 | 2039 | e.id = sec->id; |