2004-02-11 Andrew Cagney <cagney@redhat.com>
[binutils-gdb.git] / bfd / ChangeLog
1 2004-02-11 Andrew Cagney <cagney@redhat.com>
2
3 * bfd-in.h: Update copyright.
4 (bfd_tell): Change return type to file_ptr.
5 * bfd-in2.h: Re-generate.
6 * cache.c: Update copyright.
7 (bfd_cache_lookup_worker): Use real_fseek, do not cast offset
8 parameter.
9 (close_one): Use real_ftell.
10 * bfdio.c: Update copyright.
11 (real_ftell, real_fseek): New functions.
12 (bfd_tell): Use real_fseek and real_ftell, change return type to
13 file_ptr.
14 (bfd_seek): Use real_ftell and real_fseek, change type of
15 file_position to a file_ptr.
16 * libbfd-in.h: Update copyright.
17 (real_ftell, real_fseek): Declare.
18 * libbfd.h: Re-generate.
19
20 * configure.in (AC_CHECK_FUNCS): Check for ftello, ftello64,
21 fseeko and fseeko64. Determine bfd_file_ptr.
22 * configure: Re-generate.
23 * config.in: Re-generate.
24
25 2004-02-09 Anil Paranjpe <anilp1@KPITCummins.com>
26
27 * coff-h8300.c: Added comments about relaxation for ldc.w and stc.w.
28 * elf32-h8300.c: Likewise.
29
30 2004-02-09 Christian Vogel <vogelchr@vogel.cx>
31 Nick Clifton <nickc@redhat.com>
32
33 * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Catch
34 GOT entries with no associated GOT subsection.
35
36 2004-02-09 Richard Sandiford <rsandifo@redhat.com>
37
38 * bfd-elf.h (elf_backend_name_local_section_symbols): New hook.
39 * elf.c (swap_out_syms): Use it to decide whether local section
40 symbols should be named.
41 * elfxx-target.h (elf_backend_name_local_section_symbols): New macro.
42 * elfxx-mips.h (_bfd_mips_elf_name_local_section_symbols): Declare.
43 (elf_backend_name_local_section_symbols): Define.
44 * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): New.
45
46 2004-01-30 H.J. Lu <hongjiu.lu@intel.com>
47
48 * elfxx-ia64.c (elfNN_ia64_relax_brl): New function.
49 (elfNN_ia64_relax_section): Optimize brl to br during the relax
50 finalize pass.
51
52 2004-01-30 Alexandre Oliva <aoliva@redhat.com>
53
54 * elf32-frv.c (elf32_frv_always_size_sections): Initialize pointer
55 to bfd_link_hash_entry passed by reference to
56 _bfd_generic_link_add_one_symbol.
57
58 2004-01-25 H.J. Lu <hongjiu.lu@intel.com>
59
60 * elfxx-ia64.c (elfNN_ia64_relocate_section): Disallow imm
61 relocations against dynamic symbols.
62
63 2004-01-23 Daniel Jacobowitz <drow@mvista.com>
64
65 * elf32-arm.h (elf32_arm_check_relocs): Revert part of 2004-01-13
66 change.
67
68 2004-01-21 Tom Rix <tcrix@worldnet.att.net>
69
70 * reloc.c: New 5 bit reloc, BFD_RELOC_M68HC12_5B, for m68hc12 movb/movw.
71 * bfd-in2.h, libbfd.h: Rebuilt.
72
73 2004-01-20 Danny Smith <dannysmith@users.sourceforge.net>
74
75 * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Don't remove
76 IMAGE_SCN_MEM_WRITE flag from .text section if WP_TEXT
77 flag has been cleared.
78
79 2004-01-19 Kazu Hirata <kazu@cs.umass.edu>
80
81 * coff-h8300.c: Add and adjust comments about relaxation.
82 * elf32-h8300.c: Likewise.
83
84 2004-01-16 Kazu Hirata <kazu@cs.umass.edu>
85
86 * coff-h8300.c: Fix comment typos.
87 * elf32-h8300.c: Likewise.
88
89 2004-01-16 Kazu Hirata <kazu@cs.umass.edu>
90
91 * coff-h8300.c: Add comments about relaxation.
92 * elf32-h8300.c: Likewise.
93
94 2004-01-14 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
95
96 * acinclude.m4: Quote names of macros to be defined by AC_DEFUN
97 throughout.
98 * aclocal.m4: Regenerate.
99 * configure: Regenerate.
100
101 2004-01-13 Ian Lance Taylor <ian@wasabisystems.com>
102
103 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Call
104 mips_elf64_rtype_to_howto instead of using howto_table.
105
106 2004-01-13 Daniel Jacobowitz <drow@mvista.com>
107
108 * elf32-arm.h (elf32_arm_final_link_relocate): Check that we created
109 the .plt section.
110 (elf32_arm_check_relocs): Don't increment the PLT refcount for
111 relocs which would not use the PLT.
112
113 2004-01-13 Alan Modra <amodra@bigpond.net.au>
114
115 * elf64-ppc.c (ppc64_elf_check_relocs): Ignore !SEC_ALLOC relocs.
116 (ppc64_elf_gc_sweep_hook): Likewise.
117 (ppc64_elf_size_dynamic_sections): Test for .plt directly.
118
119 2004-01-12 Anil Paranjpe <anilp1@KPITCummins.com>
120
121 Adds linker relaxation support for bit manipulation insns like
122 band, bclr, biand, bild, bior, bist, bixor, bld, bnot, bor, bset,
123 bst, btst, bxor.
124 * elf32-h8300.c: Opcode for bit manipulation insn is checked in
125 elf32_h8_relax_section function while relxation for aa:16 and aa:32.
126 * coff-h8300.c: Opcode for bit manipulation insn is checked in
127 h8300_reloc16_extra_cases function while relxation for aa:16 and aa:32.
128
129 2004-01-12 Alan Modra <amodra@bigpond.net.au>
130
131 * dwarf2.c: Convert to C90, remove unneeded casts and prototypes.
132
133 2004-01-11 Kazu Hirata <kazu@cs.umass.edu>
134
135 * elf32-h8300.c: Fix formatting.
136
137 2004-01-11 Kazu Hirata <kazu@cs.umass.edu>
138
139 * elf32-cris.c (cris_elf_gc_sweep_hook): Return early if no
140 dynamic object is present. Declare r_symndx and h in an inner
141 scope.
142 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
143
144 2004-01-09 Daniel Jacobowitz <drow@mvista.com>
145
146 * elf32-arm.h (struct elf32_arm_relocs_copied): Remove pc_count.
147 (elf32_arm_copy_indirect_symbol): Don't copy pc_count.
148 (elf32_arm_final_link_relocate): Handle PLT32 and PC24 relocs
149 identically. Do not emit PC24 relocations for shared libraries.
150 (elf32_arm_gc_sweep_hook): Handle PLT32 and PC24 relocs
151 identically. Don't adjust pc_count.
152 (elf32_arm_check_relocs): Handle PLT32 and PC24 relocs identically.
153 Set ELF_LINK_HASH_NEEDS_PLT for both. Don't adjust pc_count; don't
154 adjust count for branch relocations.
155 (allocate_dynrelocs): Correct typo in call to
156 WILL_CALL_FINISH_DYNAMIC_SYMBOL. Never allocate space for
157 PC24 or PLT32 relocs when linking.
158
159 2004-01-09 Dmitry Semyonov <Dmitry.Semyonov@oktet.ru>
160
161 * coff-arm.c (aoutarm_std_reloc_howto): [ARM_WINCE] Synchronize ARM_26D
162 relocation howto with ARM_26 one for consistency.
163 (coff_arm_relocate_section): Set partial_inplace for ARM_26 relocations
164 that will be converted to ARM_26D ones, since we always want 'done'
165 relocations to be reflected in section's data.
166 (coff_arm_relocate_section): [ARM_WINCE] Quick fix for BL instruction
167 offset.
168 (_bfd_final_link_relocate): Do not modify "inplace" data, if not
169 requested.
170
171 2004-01-08 Dmitry Semyonov <Dmitry.Semyonov@oktet.ru>
172
173 * coff-arm.c (coff_arm_relocate_section): Do not alter relocs that
174 are not partial_inplace during a relocatable link.
175
176 2004-01-08 Kazu Hirata <kazu@cs.umass.edu>
177
178 * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return early
179 if no dynamic object is present. Declare r_symndx and h in an
180 inner scope.
181
182 2004-01-07 H.J. Lu <hongjiu.lu@intel.com>
183
184 * elfxx-ia64.c (elfNN_ia64_relax_section): Don't install
185 trampoline if it is known out of range.
186
187 2004-01-06 Alexandre Oliva <aoliva@redhat.com>
188
189 2003-12-17 Alexandre Oliva <aoliva@redhat.com>
190 * elf32-frv.c (_frv_osec_readonly_p): New.
191 (_frv_emit_got_relocs_plt_entries): Don't emit rofixup for
192 undefweak symbol.
193 (_frv_count_got_plt_entries): Adjust expected count accordingly.
194 (elf32_frv_relocate_section): Likewise. Error out if attempting
195 to emit rofixups or dynamic relocs in read-only segments. Use
196 _bfd_elf_section_offset to adjust r_offsets in rofixups and
197 dynamic relocations.
198 2003-12-12 Alexandre Oliva <aoliva@redhat.com>
199 * elf32-frv.c (elf32_frv_relocate_section): Compute dynamic
200 relocations or fixups involving merged sections correctly. Avoid
201 crash when undefined symbol is referenced by R_FRV_32 or
202 R_FRV_FUNCDESC_VALUE.
203 2003-12-02 Alexandre Oliva <aoliva@redhat.com>
204 * elf32-frv.c (elf32_frv_relocate_section): Add output_offset of
205 input section holding local symbol to addend of R_FRV_32 or
206 R_FRV_FUNCDESC_VALUE dynamic relocation.
207 2003-11-27 Alexandre Oliva <aoliva@redhat.com>
208 * elf32-frv.c (elf32_frv_modify_segment_map): Add link info arg.
209 (elf32_frv_always_size_sections): Don't store pointer to
210 __stacksize symbol in sec_info.
211 (elf32_frv_modify_segment_map): Look it up here.
212 2003-11-26 Alexandre Oliva <aoliva@redhat.com>
213 * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Emit the address
214 of the lazy PLT entry, not only its offset, as the low word of a
215 function descriptor.
216 2003-11-10 Alexandre Oliva <aoliva@redhat.com>
217 * elf32-frv.c (elf32_frv_always_size_sections): Define __stacksize
218 if a hash table entry already exists but is not a definition.
219 2003-11-05 Alexandre Oliva <aoliva@redhat.com>
220 * elf32-frv.c (frv_elf_link_hash_table_create): Use bfd_zalloc.
221 (_frv_add_rofixup): Don't inline.
222 (_frv_emit_got_relocs_plt_entries): Use NULL as funcdesc address
223 for undefweak symbols.
224 (elf32_frv_relocate_section): Avoid crash while computing
225 relocation when linking with shared library. Only emit rofixups
226 and dynamic relocations for alloc&load sections. Mark binaries
227 with inter-segment relocations for relocation as a unit.
228 (_frv_create_got_section): Rename .rofixup.got to .rofixup.
229 (DEFAULT_STACK_SIZE): New.
230 (_frv_count_got_plt_entries): Fix thinko in deciding whether to
231 emit rofixups or dynamic relocs when linking dynamic non-PIE
232 executables.
233 (elf32_frv_size_dynamic_sections): Generate rofixup on PIEs and
234 shared libs too. Reserve the last entry for the GOT pointer.
235 (elf32_frv_finish_dynamic_sections): Emit it.
236 (elf32_frv_always_size_sections): New.
237 (elf32_frv_modify_segment_map): New.
238 (elf32_frv_check_relocs): Reserve relocs32 space only in ALLOC
239 sections.
240 (frv_elf_merge_private_bfd_data): Clear PIC bit if FDPIC is set.
241 (frv_elf_print_private_bfd_data): Handle FDPIC and LIBPIC.
242 (elf_backend_always_size_sections): New.
243 (elf_backend_modify_segment_map): New.
244 2003-10-31 Alexandre Oliva <aoliva@redhat.com>
245 * config.bfd: Added frv-*-*linux*.
246 * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Use idx 0 for
247 ABS section, instead of crashing.
248 (elf32_frv_relocate_section): Don't crash before warning about
249 different segments in non-PIC relocation.
250 2003-10-17 Alexandre Oliva <aoliva@redhat.com>
251 * elf32-frv.c (elf32_frv_relocate_section): Don't warn on LABEL24
252 relocs to undefweak symbols.
253 (elf32_frv_relocate_section): Ditto for undefined symbols.
254 2003-10-06 Alexandre Oliva <aoliva@redhat.com>
255 * elf32-frv.c (elf32_frv_create_dynamic_sections): Make sure
256 gotfixup section was created.
257 2003-09-30 Alexandre Oliva <aoliva@redhat.com>
258 * elf32-frv.c (elf32_frv_howto_table): Change GOT12,
259 FUNCDESC_GOT12, GOTOFF12 and FUNCDESC_GOTOFF12 to
260 complain_overflow_signed.
261 * elf32-frv.c (_frv_add_rofixup): Do not error out if contents
262 have not been allocated.
263 (_frv_emit_got_relocs_plt_entries): Return non-void. Assert
264 privfd only if dynamic sections were created.
265 (elf32_frv_relocate_section): Compute gprel_segment, and use it
266 for GPREL relocs. When linking relocatable FDPIC executables,
267 emit warnings for relocations that would be illegal on PIE or
268 shared libraries. Emit rofixup for R_FRV_32 only if input object
269 is not FDPIC.
270 (_frv_create_got_section): Define _gp symbol in the rofixup
271 section.
272 (elf32_frv_finish_dynamic_sections): If rofixups needed but
273 dynamic sections missing, error out requesting -melf32frvfd.
274 2003-09-19 Alexandre Oliva <aoliva@redhat.com>
275 * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Rearrange
276 computation of addends from section and global or local symbol
277 value. Change return type to bfd_boolean, and return a failure if
278 a dynamic FUNCDESC or FUNCDESC_VALUE relocation that requires a
279 nonzero addend is required.
280 (elf32_frv_relocate_section): Likewise. Print error for
281 unsupported nonzero addends.
282 2003-09-18 Alexandre Oliva <aoliva@redhat.com>
283 * elf32-frv.c (FRV_SYM_LOCAL): In the absence of dynamic sections,
284 force everything local.
285 (_frv_emit_got_relocs_plt_entries): Cope with NULL sec.
286 * elf32-frv.c (struct frv_elf_link_hash_table): Added sgotfixup.
287 (frv_gotfixup_section): New.
288 (FRV_SYM_LOCAL): Accept undefweak and local common symbols.
289 (struct frv_pic_relocs_info): Split relocs into relocs32, relocsfd
290 and relocsfdv.
291 (_frv_add_rofixup): New.
292 (_frv_emit_got_relocs_plt_entries): Generate fixups for non-PIE
293 fdpic executables. Use FRV_SYM_LOCAL more widely to simplify and
294 improve some ugly conditions.
295 (elf32_frv_relocate_section): Likewise. Reject inter-segment
296 relocations in fdpic.
297 (_frv_create_got_section): Create .rofixup.got section.
298 (struct _frv_dynamic_got_info): Added fixups.
299 (_frv_count_got_plt_entries): Account in-GOT relocations into
300 relocs32, relocsfd and relocsfdv. Account them into relocs or
301 fixups, as appropriate.
302 (elf32_frv_size_dynamic_sections): Size rofixup section. Simplify
303 sizing of gotrel.
304 (elf32_frv_finish_dynamic_sections): Verify that the right number
305 of relocations and fixups was generated.
306 (elf32_frv_check_relocs): Compute relocs32, relocsfd and
307 relocsfdv.
308 * elf32-frv.c (FRV_SYM_LOCAL): New macro, used instead of
309 SYMBOL_CALLS_LOCAL and SYMBOL_REFERENCES_LOCAL.
310 (FRV_FUNCDESC_LOCAL): New macro, used to decide whether a function
311 descriptor of a (formerly-)global symbol is local.
312 (struct frv_pic_relocs_info): Adjust comments.
313 (_frv_emit_got_relocs_plt_entries): Adjust.
314 (elf32_frv_relocate_section): Likewise.
315 (_frv_count_got_plt_entries): Likewise.
316 * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Don't add global
317 symbol's value to addend in the common preamble. Decay dynamic
318 symbols to section+offset if they bind or call locally, for GOT
319 and FUNCDESC_VALUE, respectively.
320 (elf32_frv_relocate_section): Likewise.
321 (elf32_frv_check_relocs): Don't register as dynamic symbols of
322 internal or hidden visibility.
323 2003-09-17 Alexandre Oliva <aoliva@redhat.com>
324 * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Get addend as
325 argument, so as to not call _bfd_elf_rel_local_sym to compute it.
326 (elf32_frv_relocate_section): Pass relocation addend in. Use
327 original relocation addend to look up the got relocs/plt entries
328 table. Do not call _bfd_elf_rel_local_sym. Don't error out when
329 processing relocations that reference .scommon symbols.
330 2003-09-15 Alexandre Oliva <aoliva@redhat.com>
331 Introduce support for dynamic linking.
332 * elf32-frv.c (R_FRV_FUNCDESC_VALUE): Mark it as 64 bits.
333 (elf32_frv_rel_32_howto, elf32_frv_rel_funcdesc_howto,
334 elf32_frv_rel_funcdesc_value_howto): New REL descriptors.
335 (frv_reloc_type_lookup): Return REL howtos for executables and
336 dynamic libraries.
337 (frv_info_to_howto_rel): New.
338 (struct frv_elf_link_hash_table): New.
339 (frv_hash_table, frv_got_section, frv_gotrel_section,
340 frv_plt_section, frv_pltrel_section, frv_relocs_info,
341 frv_got_initial_offset, frv_plt_initial_offset): New macros.
342 (frv_elf_link_hash_table_create): New.
343 (struct frv_pic_relocs_info): New.
344 (frv_pic_relocs_info_hash, frv_pic_relocs_info_eq): New.
345 (frv_pic_relocs_info_find): New.
346 (frv_pic_relocs_info_for_global, frv_pic_relocs_info_for_local):
347 New.
348 (FRV_LZPLT_BLOCK_SIZE, FRV_LZPLT_RESOLVE_LOC): New.
349 (_frv_add_dyn_reloc, _frv_osec_to_segment): New.
350 (_frv_emit_got_relocs_plt_entries): New.
351 (elf32_frv_relocate_section): Add support for dynamic linking.
352 Handle new relocations.
353 (_frv_create_got_section): New.
354 (elf32_frv_create_dynamic_sections): New.
355 (ELF_DYNAMIC_INTERPRETER): New.
356 (struct _frv_dynamic_got_info): New.
357 (_frv_count_got_plt_entries): New.
358 (struct _frv_dynamic_got_plt_info): New.
359 (_frv_compute_got_alloc_data): New.
360 (_frv_get_got_entry, _frv_get_fd_entry): New.
361 (_frv_assign_got_entries, _frv_assign_plt_entries): New.
362 (_frv_resolve_final_relocs_info): New.
363 (elf32_frv_size_dynamic_sections): New.
364 (elf32_frv_finish_dynamic_sections): New.
365 (elf32_frv_adjust_dynamic_symbol): New.
366 (elf32_frv_finish_dynamic_symbol): New.
367 (elf32_frv_check_relocs): Handle new relocs. Explain how the
368 whole thing works.
369 (elf_info_to_howto_rel): Define.
370 (bfd_elf32_bfd_link_hash_table_create): Define.
371 (elf_backend_create_dynamic_sections): Define.
372 (elf_backend_adjust_dynamic_symbol): Define.
373 (elf_backend_size_dynamic_sections): Define.
374 (elf_backend_finish_dynamic_symbol): Define.
375 (elf_backend_finish_dynamic_sections): Define.
376 (elf_backend_want_got_sym): Define.
377 (elf_backend_got_header_size): Define.
378 (elf_backend_want_got_plt): Define.
379 (elf_backend_plt_readonly): Define.
380 (elf_backend_want_plt_sym): Define.
381 (elf_backend_plt_header_size): Define.
382 (elf_backend_may_use_rel_p): Define.
383 (elf_backend_may_use_rela_p): Define.
384 (elf_backend_default_use_rela_p): Define.
385 2003-08-08 Alexandre Oliva <aoliva@redhat.com>
386 * elf32-frv.c (R_FRV_FUNCDESC_VALUE, R_FRV_FUNCDESC_GOTOFF12,
387 R_FRV_FUNCDESC_GOTOFFHI, R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12,
388 R_FRV_GOTOFFHI, R_FRV_GOTOFFLO): New.
389 (frv_reloc_map): Map the corresponding BFD relocs to them.
390 (frv_reloc_type_lookup): ... and back to BFD relocs.
391 * reloc.c: New relocs.
392 * bfd-in2.h, libbfd.h: Rebuilt.
393 2003-08-04 Alexandre Oliva <aoliva@redhat.com>
394 * elf32-frv.c (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO,
395 R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI,
396 R_FRV_FUNCDESC_GOTLO): New.
397 (frv_reloc_map): Map the corresponding BFD relocs to them.
398 (frv_reloc_type_lookup): ... and back to BFD relocs.
399 * reloc.c: New relocs.
400 * bfd-in2.h, libbfd.h: Rebuilt.
401
402 2004-01-05 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
403
404 * elf32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
405 targets to support pages of up to 64kB.
406 (elf32_bed): Redefine to get a separate backend data structure for
407 traditional targets.
408 * elf64-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
409 targets to support pages of up to 64kB.
410 (elf64_bed): Redefine to get a separate backend data structure for
411 traditional targets.
412 * elfn32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional
413 targets to support pages of up to 64kB.
414 (elf32_bed): Redefine to get a separate backend data structure for
415 traditional targets.
416
417 2004-01-04 Mark Kettenis <kettenis@gnu.org>
418
419 * elf32-sparc.c (elf32_sparc_grok_psinfo): New function.
420
421 2004-01-02 Mark Kettenis <kettenis@gnu.org>
422
423 * elf32-i386.c (elf_i386_grok_prstatus): Add support for FreeBSD.
424 (elf_i386_grok_psinfo): Likewise.
425
426 2004-01-02 Bernardo Innocenti <bernie@develer.com>
427
428 * config.bfd: Add m68k-uClinux target.
429
430 2004-01-01 Grant Edwards <grante@visi.com>
431
432 * elflink.h (elf_gc_sections): Warn when gc-sections option is ignored.
433 * elf32-h8300.c (elf32_h8_gc_mark_hook): New function.
434 (elf32_h8_gc_sweep_hook): New function.
435 (elf_backend_gc_mark_hook): Define.
436 (elf_backend_gc_sweep_hook): Define.
437 (elf_backend_can_gc_sections): Define.
438
439 For older changes see ChangeLog-0203
440 \f
441 Local Variables:
442 mode: change-log
443 left-margin: 8
444 fill-column: 74
445 version-control: never
446 End: