Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/binutils/2.18: 97_all_binutils-freebsd-sysv-pr4424.patch README.history
Date: Mon, 23 Jun 2008 02:06:30
Message-Id: E1KAbRo-00042Z-7W@stork.gentoo.org
1 vapier 08/06/23 02:06:24
2
3 Modified: README.history
4 Added: 97_all_binutils-freebsd-sysv-pr4424.patch
5 Log:
6 add backport for freebsd #223249
7
8 Revision Changes Path
9 1.5 src/patchsets/binutils/2.18/README.history
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.18/README.history?rev=1.5&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.18/README.history?rev=1.5&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.18/README.history?r1=1.4&r2=1.5
14
15 Index: README.history
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/src/patchsets/binutils/2.18/README.history,v
18 retrieving revision 1.4
19 retrieving revision 1.5
20 diff -u -r1.4 -r1.5
21 --- README.history 3 Apr 2008 18:03:59 -0000 1.4
22 +++ README.history 23 Jun 2008 02:06:23 -0000 1.5
23 @@ -1,5 +1,6 @@
24 -1.6 [pending]
25 +1.6 22.06.2008
26 - 13_all_mips-gnu-hash-support.patch
27 + + 97_all_binutils-freebsd-sysv-pr4424.patch
28
29 1.5
30 + 18_all_binutils-makeinfo-version.patch
31
32
33
34 1.1 src/patchsets/binutils/2.18/97_all_binutils-freebsd-sysv-pr4424.patch
35
36 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.18/97_all_binutils-freebsd-sysv-pr4424.patch?rev=1.1&view=markup
37 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.18/97_all_binutils-freebsd-sysv-pr4424.patch?rev=1.1&content-type=text/plain
38
39 Index: 97_all_binutils-freebsd-sysv-pr4424.patch
40 ===================================================================
41 backport of upstream fix
42
43 http://bugs.gentoo.org/223249
44
45 PR ld/4424
46 * config.bfd (targ_selvecs): Add bfd_elf64_alpha_vec for
47 alpha/FreeBSD. Add bfd_elf64_sparc_vec for sparc64/FreeBSD.
48 Add bfd_elf32_i386_vec and bfd_efi_app_ia32_vec for i386/FreeBSD.
49 (targ64_selvecs): Set for i386/FreeBSD.
50 * elf-bfd.h (elf_backend_data): Add relocs_compatible.
51 (_bfd_elf_default_relocs_compatible): Declare.
52 (_bfd_elf_relocs_compatible): Declare.
53 * elfxx-target.h (elf_backend_relocs_compatible): Define.
54 (elfNN_bed): Init new relocs_compatible field.
55 * elflink.c (_bfd_elf_default_relocs_compatible): New function.
56 (_bfd_elf_relocs_compatible): New function.
57 (elf_link_add_object_symbols): Call bed->relocs_compatible.
58 * elf32-i386.c (elf_backend_relocs_compatible): Define.
59 * elf64-alpha.c: Likewise.
60 * elf64-sparc.c: Likewise.
61 * elf64-x86-64.c: Likewise.
62
63 --- bfd/elf64-x86-64.c
64 +++ bfd/elf64-x86-64.c
65 @@ -3658,6 +3658,7 @@ static const struct bfd_elf_special_sect
66 elf64_x86_64_reloc_name_lookup
67
68 #define elf_backend_adjust_dynamic_symbol elf64_x86_64_adjust_dynamic_symbol
69 +#define elf_backend_relocs_compatible _bfd_elf_relocs_compatible
70 #define elf_backend_check_relocs elf64_x86_64_check_relocs
71 #define elf_backend_copy_indirect_symbol elf64_x86_64_copy_indirect_symbol
72 #define elf_backend_create_dynamic_sections elf64_x86_64_create_dynamic_sections
73 --- bfd/elf64-sparc.c
74 +++ bfd/elf64-sparc.c
75 @@ -870,6 +870,8 @@ const struct elf_size_info elf64_sparc_s
76
77 #define elf_backend_create_dynamic_sections \
78 _bfd_sparc_elf_create_dynamic_sections
79 +#define elf_backend_relocs_compatible \
80 + _bfd_elf_relocs_compatible
81 #define elf_backend_check_relocs \
82 _bfd_sparc_elf_check_relocs
83 #define elf_backend_adjust_dynamic_symbol \
84 --- bfd/elf64-alpha.c
85 +++ bfd/elf64-alpha.c
86 @@ -5329,6 +5329,8 @@ static const struct elf_size_info alpha_
87
88 #define elf_backend_add_symbol_hook \
89 elf64_alpha_add_symbol_hook
90 +#define elf_backend_relocs_compatible \
91 + _bfd_elf_relocs_compatible
92 #define elf_backend_check_relocs \
93 elf64_alpha_check_relocs
94 #define elf_backend_create_dynamic_sections \
95 --- bfd/elf32-i386.c
96 +++ bfd/elf32-i386.c
97 @@ -3816,9 +3816,10 @@ elf_i386_hash_symbol (struct elf_link_ha
98 #define bfd_elf32_bfd_is_local_label_name elf_i386_is_local_label_name
99 #define bfd_elf32_bfd_link_hash_table_create elf_i386_link_hash_table_create
100 #define bfd_elf32_bfd_reloc_type_lookup elf_i386_reloc_type_lookup
101 -#define bfd_elf32_bfd_reloc_name_lookup elf_i386_reloc_name_lookup
102 +#define bfd_elf32_bfd_reloc_name_lookup elf_i386_reloc_name_lookup
103
104 #define elf_backend_adjust_dynamic_symbol elf_i386_adjust_dynamic_symbol
105 +#define elf_backend_relocs_compatible _bfd_elf_relocs_compatible
106 #define elf_backend_check_relocs elf_i386_check_relocs
107 #define elf_backend_copy_indirect_symbol elf_i386_copy_indirect_symbol
108 #define elf_backend_create_dynamic_sections elf_i386_create_dynamic_sections
109 @@ -3904,7 +3905,8 @@ elf_i386_vxworks_link_hash_table_create
110 }
111
112
113 -#undef elf_backend_post_process_headers
114 +#undef elf_backend_relocs_compatible
115 +#undef elf_backend_post_process_headers
116 #undef bfd_elf32_bfd_link_hash_table_create
117 #define bfd_elf32_bfd_link_hash_table_create \
118 elf_i386_vxworks_link_hash_table_create
119 --- bfd/elfxx-target.h
120 +++ bfd/elfxx-target.h
121 @@ -378,6 +378,9 @@
122 #ifndef elf_backend_omit_section_dynsym
123 #define elf_backend_omit_section_dynsym _bfd_elf_link_omit_section_dynsym
124 #endif
125 +#ifndef elf_backend_relocs_compatible
126 +#define elf_backend_relocs_compatible _bfd_elf_default_relocs_compatible
127 +#endif
128 #ifndef elf_backend_check_relocs
129 #define elf_backend_check_relocs 0
130 #endif
131 @@ -636,6 +639,7 @@ static struct elf_backend_data elfNN_bed
132 elf_backend_link_output_symbol_hook,
133 elf_backend_create_dynamic_sections,
134 elf_backend_omit_section_dynsym,
135 + elf_backend_relocs_compatible,
136 elf_backend_check_relocs,
137 elf_backend_check_directives,
138 elf_backend_as_needed_cleanup,
139 --- bfd/elflink.c
140 +++ bfd/elflink.c
141 @@ -3243,6 +3243,40 @@ elf_finalize_dynstr (bfd *output_bfd, st
142
143 return TRUE;
144 }
145 +
146 +/* Return TRUE iff relocations for INPUT are compatible with OUTPUT.
147 + The default is to only match when the INPUT and OUTPUT are exactly
148 + the same target. */
149 +
150 +bfd_boolean
151 +_bfd_elf_default_relocs_compatible (const bfd_target *input,
152 + const bfd_target *output)
153 +{
154 + return input == output;
155 +}
156 +
157 +/* Return TRUE iff relocations for INPUT are compatible with OUTPUT.
158 + This version is used when different targets for the same architecture
159 + are virtually identical. */
160 +
161 +bfd_boolean
162 +_bfd_elf_relocs_compatible (const bfd_target *input,
163 + const bfd_target *output)
164 +{
165 + const struct elf_backend_data *obed, *ibed;
166 +
167 + if (input == output)
168 + return TRUE;
169 +
170 + ibed = xvec_get_elf_backend_data (input);
171 + obed = xvec_get_elf_backend_data (output);
172 +
173 + if (ibed->arch != obed->arch)
174 + return FALSE;
175 +
176 + /* If both backends are using this function, deem them compatible. */
177 + return ibed->relocs_compatible == obed->relocs_compatible;
178 +}
179
180 /* Add symbols from an ELF object file to the linker hash table. */
181
182 @@ -4628,7 +4662,8 @@ elf_link_add_object_symbols (bfd *abfd,
183 if (! dynamic
184 && is_elf_hash_table (htab)
185 && htab->root.creator == abfd->xvec
186 - && bed->check_relocs != NULL)
187 + && bed->check_relocs != NULL
188 + && (*bed->relocs_compatible) (abfd->xvec, htab->root.creator))
189 {
190 asection *o;
191
192 --- bfd/elf-bfd.h
193 +++ bfd/elf-bfd.h
194 @@ -700,6 +700,10 @@ struct elf_backend_data
195 bfd_boolean (*elf_backend_omit_section_dynsym)
196 (bfd *output_bfd, struct bfd_link_info *info, asection *osec);
197
198 + /* Return TRUE if relocations of targets are compatible to the extent
199 + that CHECK_RELOCS will properly process them. PR 4424. */
200 + bfd_boolean (*relocs_compatible) (const bfd_target *, const bfd_target *);
201 +
202 /* The CHECK_RELOCS function is called by the add_symbols phase of
203 the ELF backend linker. It is called once for each section with
204 relocs of an object file, just after the symbols for the object
205 @@ -1926,6 +1930,12 @@ extern void bfd_elf64_write_relocs
206 extern bfd_boolean bfd_elf64_slurp_reloc_table
207 (bfd *, asection *, asymbol **, bfd_boolean);
208
209 +extern bfd_boolean _bfd_elf_default_relocs_compatible
210 + (const bfd_target *, const bfd_target *);
211 +
212 +extern bfd_boolean _bfd_elf_relocs_compatible
213 + (const bfd_target *, const bfd_target *);
214 +
215 extern struct elf_link_hash_entry *_bfd_elf_archive_symbol_lookup
216 (bfd *, struct bfd_link_info *, const char *);
217 extern bfd_boolean bfd_elf_link_add_symbols
218 --- bfd/config.bfd
219 +++ bfd/config.bfd
220 @@ -140,7 +140,7 @@ case "${targ}" in
221 #ifdef BFD64
222 alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
223 targ_defvec=bfd_elf64_alpha_freebsd_vec
224 - targ_selvecs=ecoffalpha_little_vec
225 + targ_selvecs="bfd_elf64_alpha_vec ecoffalpha_little_vec"
226 want64=true
227 # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
228 case "${targ}" in
229 @@ -188,7 +188,7 @@ case "${targ}" in
230 ;;
231 sparc64-*-freebsd* | sparc64-*-kfreebsd*-gnu)
232 targ_defvec=bfd_elf64_sparc_freebsd_vec
233 - targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
234 + targ_selvecs="bfd_elf64_sparc_vec bfd_elf32_sparc_vec sunos_big_vec"
235 ;;
236 sparc64-*-netbsd* | sparc64-*-openbsd*)
237 targ_defvec=bfd_elf64_sparc_vec
238 @@ -535,7 +535,8 @@ case "${targ}" in
239 ;;
240 i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*)
241 targ_defvec=bfd_elf32_i386_freebsd_vec
242 - targ_selvecs=i386coff_vec
243 + targ_selvecs="bfd_elf32_i386_vec bfd_efi_app_ia32_vec i386coff_vec"
244 + targ64_selvecs="bfd_elf64_x86_64_freebsd_vec bfd_elf64_x86_64_vec bfd_efi_app_x86_64_vec"
245 # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
246 case "${targ}" in
247 i[3-7]86-*-freebsd3* | i[3-7]86-*-freebsd4 | i[3-7]86-*-freebsd4.0*)
248
249
250
251 --
252 gentoo-commits@l.g.o mailing list