aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-ia64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2002-12-04 23:59:27 +0000
committerH.J. Lu <hjl.tools@gmail.com>2002-12-04 23:59:27 +0000
commitd48770d48753cca4815607b0e1d41ab49405af1c (patch)
tree8cc643a1d46f812acbac6fae55bd470e19bb0c33 /bfd/elfxx-ia64.c
parent36478e9d6fdfc553b21fa060bf791c5e900db693 (diff)
downloadgdb-d48770d48753cca4815607b0e1d41ab49405af1c.zip
gdb-d48770d48753cca4815607b0e1d41ab49405af1c.tar.gz
gdb-d48770d48753cca4815607b0e1d41ab49405af1c.tar.bz2
2002-12-04 H.J. Lu <hjl@gnu.org>
* elfxx-ia64.c (get_local_sym_hash): Use section ID instead of BFD address when constructing local name.
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r--bfd/elfxx-ia64.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index 93741bd..2f6e1a5 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -1834,26 +1834,22 @@ get_local_sym_hash (ia64_info, abfd, rel, create)
const Elf_Internal_Rela *rel;
bfd_boolean create;
{
- char *addr_name;
- size_t len;
struct elfNN_ia64_local_hash_entry *ret;
+ asection *sec = abfd->sections;
+ char addr_name [34];
+
+ BFD_ASSERT ((sizeof (sec->id)*2 + 1 + sizeof (unsigned long)*2 + 1) <= 34);
+ BFD_ASSERT (sec);
/* Construct a string for use in the elfNN_ia64_local_hash_table.
name describes what was once anonymous memory. */
- len = sizeof (void*)*2 + 1 + sizeof (bfd_vma)*4 + 1 + 1;
- len += 10; /* %p slop */
-
- addr_name = bfd_malloc (len);
- if (addr_name == NULL)
- return 0;
- sprintf (addr_name, "%p:%lx",
- (void *) abfd, (unsigned long) ELFNN_R_SYM (rel->r_info));
+ sprintf (addr_name, "%x:%lx",
+ sec->id, (unsigned long) ELFNN_R_SYM (rel->r_info));
/* Collect the canonical entry data for this address. */
ret = elfNN_ia64_local_hash_lookup (&ia64_info->loc_hash_table,
addr_name, create, create);
- free (addr_name);
return ret;
}