• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révisiond2149d727fa0cc33a0cd4a8eee78b9fe4108bede (tree)
l'heure2009-06-17 02:45:08
AuteurH.J. Lu <hjl.tools@gmai...>
CommiterH.J. Lu

Message de Log

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.

Change Summary

Modification

--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,19 @@
11 2009-06-16 H.J. Lu <hongjiu.lu@intel.com>
22
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+
317 * elfxx-ia64.c (elfNN_ia64_link_hash_table): Remove got_sec,
418 rel_got_sec and plt_sec.
519 (elfNN_ia64_relax_section): Updated.
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2163,6 +2163,12 @@ extern bfd_boolean _bfd_elf_create_ifunc_sections
21632163 /* Large common section. */
21642164 extern asection _bfd_elf_large_com_section;
21652165
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+
21662172 /* This is the condition under which finish_dynamic_symbol will be called.
21672173 If our finish_dynamic_symbol isn't called, we'll need to do something
21682174 about initializing any .plt and .got entries in relocate_section. */
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -745,13 +745,6 @@ elf_i386_link_hash_newfunc (struct bfd_hash_entry *entry,
745745 return entry;
746746 }
747747
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-
755748 /* Compute a hash of a local hash entry. We use elf_link_hash_entry
756749 for local symbol so that we can handle local STT_GNU_IFUNC symbols
757750 as global symbol. We reuse indx and dynstr_index for local symbol
@@ -762,7 +755,7 @@ elf_i386_local_htab_hash (const void *ptr)
762755 {
763756 struct elf_link_hash_entry *h
764757 = (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);
766759 }
767760
768761 /* Compare local hash entries. */
@@ -787,8 +780,8 @@ elf_i386_get_local_sym_hash (struct elf_i386_link_hash_table *htab,
787780 {
788781 struct elf_i386_link_hash_entry e, *ret;
789782 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));
792785 void **slot;
793786
794787 e.elf.indx = sec->id;
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -559,13 +559,6 @@ elf64_x86_64_link_hash_newfunc (struct bfd_hash_entry *entry,
559559 return entry;
560560 }
561561
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-
569562 /* Compute a hash of a local hash entry. We use elf_link_hash_entry
570563 for local symbol so that we can handle local STT_GNU_IFUNC symbols
571564 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)
576569 {
577570 struct elf_link_hash_entry *h
578571 = (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);
580573 }
581574
582575 /* Compare local hash entries. */
@@ -601,8 +594,8 @@ elf64_x86_64_get_local_sym_hash (struct elf64_x86_64_link_hash_table *htab,
601594 {
602595 struct elf64_x86_64_link_hash_entry e, *ret;
603596 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));
606599 void **slot;
607600
608601 e.elf.indx = sec->id;
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -1809,8 +1809,7 @@ elfNN_ia64_local_htab_hash (const void *ptr)
18091809 struct elfNN_ia64_local_hash_entry *entry
18101810 = (struct elfNN_ia64_local_hash_entry *) ptr;
18111811
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);
18141813 }
18151814
18161815 /* Compare local hash entries. */
@@ -2033,8 +2032,8 @@ get_local_sym_hash (struct elfNN_ia64_link_hash_table *ia64_info,
20332032 {
20342033 struct elfNN_ia64_local_hash_entry e, *ret;
20352034 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));
20382037 void **slot;
20392038
20402039 e.id = sec->id;