mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-19 05:42:42 +08:00
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.
This commit is contained in:
@ -1,3 +1,17 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
2009-06-16 H.J. Lu <hongjiu.lu@intel.com>
|
2009-06-16 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* elfxx-ia64.c (elfNN_ia64_link_hash_table): Remove got_sec,
|
* elfxx-ia64.c (elfNN_ia64_link_hash_table): Remove got_sec,
|
||||||
|
@ -2163,6 +2163,12 @@ extern bfd_boolean _bfd_elf_create_ifunc_sections
|
|||||||
/* Large common section. */
|
/* Large common section. */
|
||||||
extern asection _bfd_elf_large_com_section;
|
extern asection _bfd_elf_large_com_section;
|
||||||
|
|
||||||
|
/* Hash for local symbol with the first section id, ID, in the input
|
||||||
|
file and the local symbol index, SYM. */
|
||||||
|
#define ELF_LOCAL_SYMBOL_HASH(ID, SYM) \
|
||||||
|
(((((ID) & 0xff) << 24) | (((ID) & 0xff00) << 8)) \
|
||||||
|
^ (SYM) ^ ((ID) >> 16))
|
||||||
|
|
||||||
/* This is the condition under which finish_dynamic_symbol will be called.
|
/* This is the condition under which finish_dynamic_symbol will be called.
|
||||||
If our finish_dynamic_symbol isn't called, we'll need to do something
|
If our finish_dynamic_symbol isn't called, we'll need to do something
|
||||||
about initializing any .plt and .got entries in relocate_section. */
|
about initializing any .plt and .got entries in relocate_section. */
|
||||||
|
@ -745,13 +745,6 @@ elf_i386_link_hash_newfunc (struct bfd_hash_entry *entry,
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
static hashval_t
|
|
||||||
elf_i386_local_hash (int id, int r_sym)
|
|
||||||
{
|
|
||||||
return ((((id & 0xff) << 24) | ((id & 0xff00) << 8))
|
|
||||||
^ r_sym ^ (id >> 16));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Compute a hash of a local hash entry. We use elf_link_hash_entry
|
/* Compute a hash of a local hash entry. We use elf_link_hash_entry
|
||||||
for local symbol so that we can handle local STT_GNU_IFUNC symbols
|
for local symbol so that we can handle local STT_GNU_IFUNC symbols
|
||||||
as global symbol. We reuse indx and dynstr_index for local symbol
|
as global symbol. We reuse indx and dynstr_index for local symbol
|
||||||
@ -762,7 +755,7 @@ elf_i386_local_htab_hash (const void *ptr)
|
|||||||
{
|
{
|
||||||
struct elf_link_hash_entry *h
|
struct elf_link_hash_entry *h
|
||||||
= (struct elf_link_hash_entry *) ptr;
|
= (struct elf_link_hash_entry *) ptr;
|
||||||
return elf_i386_local_hash (h->indx, h->dynstr_index);
|
return ELF_LOCAL_SYMBOL_HASH (h->indx, h->dynstr_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compare local hash entries. */
|
/* Compare local hash entries. */
|
||||||
@ -787,8 +780,8 @@ elf_i386_get_local_sym_hash (struct elf_i386_link_hash_table *htab,
|
|||||||
{
|
{
|
||||||
struct elf_i386_link_hash_entry e, *ret;
|
struct elf_i386_link_hash_entry e, *ret;
|
||||||
asection *sec = abfd->sections;
|
asection *sec = abfd->sections;
|
||||||
hashval_t h = elf_i386_local_hash (sec->id,
|
hashval_t h = ELF_LOCAL_SYMBOL_HASH (sec->id,
|
||||||
ELF32_R_SYM (rel->r_info));
|
ELF32_R_SYM (rel->r_info));
|
||||||
void **slot;
|
void **slot;
|
||||||
|
|
||||||
e.elf.indx = sec->id;
|
e.elf.indx = sec->id;
|
||||||
|
@ -559,13 +559,6 @@ elf64_x86_64_link_hash_newfunc (struct bfd_hash_entry *entry,
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
static hashval_t
|
|
||||||
elf64_x86_64_local_hash (int id, int r_sym)
|
|
||||||
{
|
|
||||||
return ((((id & 0xff) << 24) | ((id & 0xff00) << 8))
|
|
||||||
^ r_sym ^ (id >> 16));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Compute a hash of a local hash entry. We use elf_link_hash_entry
|
/* Compute a hash of a local hash entry. We use elf_link_hash_entry
|
||||||
for local symbol so that we can handle local STT_GNU_IFUNC symbols
|
for local symbol so that we can handle local STT_GNU_IFUNC symbols
|
||||||
as global symbol. We reuse indx and dynstr_index for local symbol
|
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)
|
|||||||
{
|
{
|
||||||
struct elf_link_hash_entry *h
|
struct elf_link_hash_entry *h
|
||||||
= (struct elf_link_hash_entry *) ptr;
|
= (struct elf_link_hash_entry *) ptr;
|
||||||
return elf64_x86_64_local_hash (h->indx, h->dynstr_index);
|
return ELF_LOCAL_SYMBOL_HASH (h->indx, h->dynstr_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compare local hash entries. */
|
/* Compare local hash entries. */
|
||||||
@ -601,8 +594,8 @@ elf64_x86_64_get_local_sym_hash (struct elf64_x86_64_link_hash_table *htab,
|
|||||||
{
|
{
|
||||||
struct elf64_x86_64_link_hash_entry e, *ret;
|
struct elf64_x86_64_link_hash_entry e, *ret;
|
||||||
asection *sec = abfd->sections;
|
asection *sec = abfd->sections;
|
||||||
hashval_t h = elf64_x86_64_local_hash (sec->id,
|
hashval_t h = ELF_LOCAL_SYMBOL_HASH (sec->id,
|
||||||
ELF64_R_SYM (rel->r_info));
|
ELF64_R_SYM (rel->r_info));
|
||||||
void **slot;
|
void **slot;
|
||||||
|
|
||||||
e.elf.indx = sec->id;
|
e.elf.indx = sec->id;
|
||||||
|
@ -1809,8 +1809,7 @@ elfNN_ia64_local_htab_hash (const void *ptr)
|
|||||||
struct elfNN_ia64_local_hash_entry *entry
|
struct elfNN_ia64_local_hash_entry *entry
|
||||||
= (struct elfNN_ia64_local_hash_entry *) ptr;
|
= (struct elfNN_ia64_local_hash_entry *) ptr;
|
||||||
|
|
||||||
return (((entry->id & 0xff) << 24) | ((entry->id & 0xff00) << 8))
|
return ELF_LOCAL_SYMBOL_HASH (entry->id, entry->r_sym);
|
||||||
^ entry->r_sym ^ (entry->id >> 16);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compare local hash entries. */
|
/* Compare local hash entries. */
|
||||||
@ -2033,8 +2032,8 @@ get_local_sym_hash (struct elfNN_ia64_link_hash_table *ia64_info,
|
|||||||
{
|
{
|
||||||
struct elfNN_ia64_local_hash_entry e, *ret;
|
struct elfNN_ia64_local_hash_entry e, *ret;
|
||||||
asection *sec = abfd->sections;
|
asection *sec = abfd->sections;
|
||||||
hashval_t h = (((sec->id & 0xff) << 24) | ((sec->id & 0xff00) << 8))
|
hashval_t h = ELF_LOCAL_SYMBOL_HASH (sec->id,
|
||||||
^ ELFNN_R_SYM (rel->r_info) ^ (sec->id >> 16);
|
ELFNN_R_SYM (rel->r_info));
|
||||||
void **slot;
|
void **slot;
|
||||||
|
|
||||||
e.id = sec->id;
|
e.id = sec->id;
|
||||||
|
Reference in New Issue
Block a user