]> git.pld-linux.org Git - packages/binutils.git/blob - binutils-ia64-bootstrap.patch
- fix for gas SEGV on .end without .ent (alpha only)
[packages/binutils.git] / binutils-ia64-bootstrap.patch
1 2002-11-29  Jakub Jelinek  <jakub@redhat.com>
2
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.
9
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;
14  };
15  
16 +struct elfNN_ia64_obj_tdata
17 +{
18 +  struct elf_obj_tdata root;
19 +  unsigned long key;
20 +};
21 +
22 +#define elfNN_ia64_tdata(abfd) \
23 +  ((struct elfNN_ia64_obj_tdata *) (abfd)->tdata.any)
24 +
25  #define elfNN_ia64_hash_table(p) \
26    ((struct elfNN_ia64_link_hash_table *) ((p)->hash))
27  
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;
39       boolean create;
40  {
41 -  char *addr_name;
42 -  size_t len;
43 +  char *addr_name [2 * sizeof (unsigned long) + 2];
44    struct elfNN_ia64_local_hash_entry *ret;
45 +  static unsigned long key;
46 +
47 +  if (! elfNN_ia64_tdata (abfd)->key)
48 +    elfNN_ia64_tdata (abfd)->key = ++key;
49  
50    /* Construct a string for use in the elfNN_ia64_local_hash_table.
51       name describes what was once anonymous memory.  */
52  
53 -  len = sizeof (void*)*2 + 1 + sizeof (bfd_vma)*4 + 1 + 1;
54 -  len += 10;   /* %p slop */
55 -
56 -  addr_name = bfd_malloc (len);
57 -  if (addr_name == NULL)
58 -    return 0;
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));
63  
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);
67 -  free (addr_name);
68    return ret;
69  }
70  
71 @@ -4660,6 +4667,32 @@ elfNN_ia64_reloc_type_class (rela)
72  }
73  
74  static boolean
75 +elfNN_ia64_mkobject (abfd)
76 +     bfd *abfd;
77 +{
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)
81 +    return false;
82 +  return true;
83 +}
84 +
85 +static boolean
86 +elfNN_ia64_object_p (abfd)
87 +     bfd *abfd;
88 +{
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)
94 +    return false;
95 +  new_tdata->root = *abfd->tdata.elf_obj_data;
96 +  abfd->tdata.any = new_tdata;
97 +  return true;
98 +}
99 +
100 +static boolean
101  elfNN_ia64_hpux_vec (const bfd_target *vec)
102  {
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
107  
108 +#define bfd_elfNN_mkobject     elfNN_ia64_mkobject
109 +#define elf_backend_object_p   elfNN_ia64_object_p
110 +
111  #define bfd_elfNN_bfd_reloc_type_lookup \
112         elfNN_ia64_reloc_type_lookup
113  #define bfd_elfNN_bfd_is_local_label_name \
This page took 0.081689 seconds and 3 git commands to generate.