1 2002-11-29 Jakub Jelinek <jakub@redhat.com>
3 * elfxx-ia64.c (elfNN_ia64_obj_tdata): New struct.
4 (elfNN_ia64_tdata): New macro.
5 (elfNN_ia64_mkobject, elfNN_ia64_object_p): New functions.
6 (get_local_sym_hash): Assign keys to input bfds instead of using
7 their pointer addresses for hashing purposes.
8 (bfd_elfNN_mkobject, elf_backend_object_p): Define.
10 --- binutils-2.13.90.0.16/bfd/elfxx-ia64.c.jj 2002-11-28 15:49:52.000000000 +0100
11 +++ binutils-2.13.90.0.16/bfd/elfxx-ia64.c 2002-11-29 01:38:39.000000000 +0100
12 @@ -152,6 +152,15 @@ struct elfNN_ia64_link_hash_table
13 struct elfNN_ia64_local_hash_table loc_hash_table;
16 +struct elfNN_ia64_obj_tdata
18 + struct elf_obj_tdata root;
22 +#define elfNN_ia64_tdata(abfd) \
23 + ((struct elfNN_ia64_obj_tdata *) (abfd)->tdata.any)
25 #define elfNN_ia64_hash_table(p) \
26 ((struct elfNN_ia64_link_hash_table *) ((p)->hash))
28 @@ -317,6 +326,8 @@ static boolean elfNN_ia64_print_private_
29 PARAMS ((bfd *abfd, PTR ptr));
30 static enum elf_reloc_type_class elfNN_ia64_reloc_type_class
31 PARAMS ((const Elf_Internal_Rela *));
32 +static boolean elfNN_ia64_mkobject PARAMS ((bfd *));
33 +static boolean elfNN_ia64_object_p PARAMS ((bfd *));
34 static boolean elfNN_ia64_hpux_vec
35 PARAMS ((const bfd_target *vec));
36 static void elfNN_hpux_post_process_headers
37 @@ -1834,26 +1845,22 @@ get_local_sym_hash (ia64_info, abfd, rel
38 const Elf_Internal_Rela *rel;
43 + char *addr_name [2 * sizeof (unsigned long) + 2];
44 struct elfNN_ia64_local_hash_entry *ret;
45 + static unsigned long key;
47 + if (! elfNN_ia64_tdata (abfd)->key)
48 + elfNN_ia64_tdata (abfd)->key = ++key;
50 /* Construct a string for use in the elfNN_ia64_local_hash_table.
51 name describes what was once anonymous memory. */
53 - len = sizeof (void*)*2 + 1 + sizeof (bfd_vma)*4 + 1 + 1;
54 - len += 10; /* %p slop */
56 - addr_name = bfd_malloc (len);
57 - if (addr_name == NULL)
59 - sprintf (addr_name, "%p:%lx",
60 - (void *) abfd, (unsigned long) ELFNN_R_SYM (rel->r_info));
61 + sprintf (addr_name, "%lx:%lx", elfNN_ia64_tdata (abfd)->key,
62 + (unsigned long) ELFNN_R_SYM (rel->r_info));
64 /* Collect the canonical entry data for this address. */
65 ret = elfNN_ia64_local_hash_lookup (&ia64_info->loc_hash_table,
66 addr_name, create, create);
71 @@ -4660,6 +4667,32 @@ elfNN_ia64_reloc_type_class (rela)
75 +elfNN_ia64_mkobject (abfd)
78 + bfd_size_type amt = sizeof (struct elfNN_ia64_obj_tdata);
79 + abfd->tdata.any = bfd_zalloc (abfd, amt);
80 + if (abfd->tdata.any == NULL)
86 +elfNN_ia64_object_p (abfd)
89 + /* Allocate our special target data. */
90 + struct elfNN_ia64_obj_tdata *new_tdata;
91 + bfd_size_type amt = sizeof (struct elfNN_ia64_obj_tdata);
92 + new_tdata = bfd_zalloc (abfd, amt);
93 + if (new_tdata == NULL)
95 + new_tdata->root = *abfd->tdata.elf_obj_data;
96 + abfd->tdata.any = new_tdata;
101 elfNN_ia64_hpux_vec (const bfd_target *vec)
103 extern const bfd_target bfd_elfNN_ia64_hpux_big_vec;
104 @@ -4718,6 +4751,9 @@ elfNN_hpux_backend_section_from_bfd_sect
105 #define elf_info_to_howto \
106 elfNN_ia64_info_to_howto
108 +#define bfd_elfNN_mkobject elfNN_ia64_mkobject
109 +#define elf_backend_object_p elfNN_ia64_object_p
111 #define bfd_elfNN_bfd_reloc_type_lookup \
112 elfNN_ia64_reloc_type_lookup
113 #define bfd_elfNN_bfd_is_local_label_name \