* irix-core.c (irix_core_core_file_p): Ignore sections that
[platform/upstream/binutils.git] / bfd / ChangeLog
1 Sat Aug  6 22:27:30 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
2
3         * irix-core.c (irix_core_core_file_p):  Ignore sections that
4         are not contained in the core file.
5
6 Thu Aug  4 11:32:23 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
7
8         * coff-m68k.c (m68k_reloc_type_lookup): New function.
9         (coff_bfd_reloc_type_lookup): Define.
10         * cf-m68klynx.c (_bfd_m68kcoff_reloc_type_lookup): Define.
11
12         * elfcode.h (elf_bfd_final_link): Force the vma of sections which
13         do not have SEC_ALLOC set to be 0.  This is needed to handle
14         relocs against debugging sections.
15
16 Wed Aug  3 16:45:41 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
17
18         * coff-i960.c (coff_i960_relocate): Rewrote to change relocs
19         against locally defined symbols into relocs against section
20         symbols, for VxWorks 5.1.
21
22 Wed Aug  3 10:34:37 1994  Eric Youngdale  (ericy@cais.cais.com)
23
24         * i386linux.c (linux_add_one_symbol): Only handle
25         SHARABLE_CONFLICTS specially if BSF_CONSTRUCTOR is set.  Set hashp
26         for a GOT or PLT symbol.  Set jump field of fixup for a PLT symbol.
27         (linux_tally_symbols): Check section of real symbol.  When looking
28         for a builtin fixup, check builtin and jump flags.  Create no more
29         than one fixup, and always create one if the real symbol is in the
30         absolute section.  Only strip absolute symbols.
31
32 Wed Aug  3 05:08:24 1994  D. V. Henkel-Wallace  (gumby@cygnus.com)
33
34         * coffcode.h (coff_write_object_contents): set internal_a.magic to
35         LYNXCOFFMAGIC whenever 68k, SPARC or i386 LynxOS
36         (yes, they have the same magic number!)
37
38 Tue Aug  2 10:43:21 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
39
40         * hp300hpux.c (BMAGIC): Define as HPUX_DOT_O_MAGIC, to make test
41         in aoutx.h work correctly.
42
43         * coff-i960.c (coff_i960_relocate): New function.
44         (howto_rellong, howto_iprmed): Use it as special_function.
45
46         * libbfd-in.h: Move declarations of bfd_read, bfd_write, bfd_seek,
47         bfd_tell, bfd_flush, and bfd_stat from here...
48         * bfd-in.h: ...to here, to make them visible to programs which
49         know more about the object file format than BFD does.
50         * libbfd.h, bfd-in2.h: Rebuilt.
51
52 Mon Aug  1 17:55:53 1994  Fred Fish  (fnf@cygnus.com)
53
54         * ptrace-core.c (ptrace_unix_core_file_p):  Convert zalloc usage
55         to bfd_zalloc.
56
57 Mon Aug  1 12:04:40 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
58
59         * elf64-sparc.c (ELF_MAXPAGESIZE): Define.
60
61         ELF linker patches from Eric Youngdale <ericy@cais.cais.com>.
62         * elfcode.h (elf_link_create_dynamic_sections): Set type of
63         _DYNAMIC to STT_OBJECT.
64         (NAME(bfd_elf,record_link_assignment)): Always create hash table
65         entry.  Set type to STT_OBJECT.
66         (elf_link_output_extsym): Don't set type of weak defined symbol to
67         STB_WEAK if symbol was referenced.
68         (map_program_segments): Check DYNAMIC as well as EXEC_P.
69         (assign_file_positions_except_relocs): Likewise.
70         * elf32-i386.c (elf_i386_create_dynamic_sections): Set type of
71         _GLOBAL_OFFSET_TABLE to STT_OBJECT.
72         (elf_i386_check_relocs): Ignore local PLT32 relocs.
73         (elf_i386_relocate_section): Treat local PLT32 relocs as PC32.
74
75         * elfcode.h (elf_adjust_dynamic_symbol): Correct weak symbol
76         handling again.
77
78         * elfcode.h (elf_slurp_reloc_table): Don't try to read the relocs
79         if there aren't any.
80
81         * configure.host (sparc-*-solaris2*): Use sysv4, not solaris2.
82         * hosts/solaris2.h: Remove.
83         * config/solaris2.mh: Remove.
84
85 Sun Jul 31 14:27:04 1994  Jeff Law  (law@snake.cs.utah.edu)
86
87         * elf32-hppa.c, elf32-hppa.h: Update comment reflecting which
88         HPPA ELF spec the code implements.
89
90 Tue Jul 26 17:38:01 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
91
92         * cpu-i960.c (MAX_ARCH): New macro.
93         (compatible): Use it in computing array bounds.  Put comma after
94         last entry in array, for regularity.
95         (arch_info_struct): Adjust spacing for easier reading.
96
97         * coff-i960.c (howto_rellong, howto_iprmed, howto_optcall): Use
98         HOWTO macro.
99
100         start-sanitize-i960xl
101         * cpu-i960.c (XL): Define as bfd_mach_i960_xl.
102         (scan_960_mach): Recognize xl machine.
103         (MAX_ARCH): Define to be XL.
104         (compatible): Add XL row to array.
105         (arch_info_struct): Add XL entry.
106
107         * archures.c (bfd_mach_i960_xl): New macro.
108         * bfd-in2.h: Regenerated.
109
110         * coffcode.h (coff_set_arch_mach_hook): For F_I960XL, set machine
111         to bfd_mach_i960_xl.
112         (coff_set_flags): For bfd_mach_i960_xl, set F_I960XL.
113         end-sanitize-i960xl
114
115 Tue Jul 26 11:04:00 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
116
117         * elfcode.h (elf_adjust_dynamic_symbol): When handling a weak
118         symbol, correct check to see whether the equivalent normal symbol
119         was referenced.
120
121         Add support for creating shared libraries under i386 ELF and SPARC
122         ELF.  Based on patches by Eric Youngdale <ericy@cais.cais.com>.
123         * libelf.h (struct elf_link_hash_entry): Remove copy_offset field.
124         Add got_offset and plt_offset fields.
125         (ELF_LINK_HASH_REF_DYNAMIC_MULTIPLE): Don't define.
126         (ELF_LINK_HASH_DEF_DYNAMIC_MULTIPLE): Don't define.
127         (ELF_LINK_HASH_NEEDS_COPY): Define.
128         (struct elf_backend_data): Add check_relocs field.
129         (struct bfd_elf_section_data): Change relocs from PTR to
130         Elf_Internal_Rela *.
131         (struct elf_obj_tdata): Add local_got_offsets field.
132         (elf_local_got_offsets): Define accessor macro.
133         (bfd_elf32_link_create_dynamic_sections): Declare.
134         (bfd_elf32_link_record_dynamic_symbol): Declare.
135         (bfd_elf64_link_create_dynamic_sections): Declare.
136         (bfd_elf64_link_record_dynamic_symbol): Declare.
137         * elfcode.h (elf_slurp_reloc_table): Don't use the section data
138         relocs field.
139         (elf_link_record_dynamic_symbol): Make globally visible.  Use
140         macro to rename to NAME(bfd_elf,link_record_dynamic_symbol).
141         (elf_link_add_object_symbols): If creating a shared library, put
142         make all local symbols dynamic.  Don't bother with the
143         DYNAMIC_MULTIPLE flags.  Call the check_relocs backend function if
144         it is defined.
145         (elf_link_create_dynamic_sections): Make globally visible.  Use
146         macro to rename to NAME(bfd_elf,link_create_dynamic_sections).  If
147         creating a shared library, make sure that _DYNAMIC is added as a
148         dynamic symbol.
149         (elf_link_read_relocs): New function.
150         (NAME(bfd_elf,record_link_assignment)): If creating a shared
151         library, always create symbols, and always make them dynamic.
152         (elf_bfd_final_link): Permit creation of shared libraries.
153         (elf_link_input_bfd): Use elf_link_read_relocs to get the relocs.
154         * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize
155         copy_offset.  Initialize got_offset and plt_offset.
156         * elf32-target.h (elf_backend_check_relocs): Define as 0 if not
157         defined.
158         (elf32_bed): Initialize check_relocs field.
159         * elf64-target.h (elf_backend_check_relocs): Define as 0 if not
160         defined.
161         (elf64_bed): Initialize check_relocs field.
162         * elf32-i386.c (elf_howto_table): Change R_386_PLT32 and
163         R_386_GOTPC to be pc_relative and pcrel_offset.
164         (elf_i386_pic_plt0_entry): Define.
165         (elf_i386_pic_plt_entry): Define.
166         (elf_i386_create_dynamic_sections): Create a .got.plt section, and
167         define _GLOBAL_OFFSET_TABLE_ at the start of it.  If creating a
168         shared library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a
169         dynamic symbol.  Don't create .rel.bss if creating a shared
170         library.
171         (elf_i386_check_relocs): New function.
172         (elf_i386_adjust_dynamic_symbol): Don't make a PLT entry if the
173         symbol already has one.  When making a PLT entry, set plt_offset.
174         Don't create a copy reloc when creating a shared library.  Don't
175         set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY.
176         (elf_i386_allocate_dynamic_section): Remove.
177         (elf_i386_size_dynamic_sections): Look through all the sections
178         rather than assuming we know their names.  Remove any empty reloc
179         or plt sections.  Only add a DT_DEBUG entry if not creating a
180         shared library.  Only add a DT_PLTGOT entry if there is a PLT.
181         Add a DT_TEXTREL entry if required.
182         (elf_i386_relocate_section): Permit undefined symbols when
183         creating a shared library.  Handle the special relocation types
184         specially.
185         (elf_i386_finish_dynamic_symbol): Create a PLT entry if plt_offset
186         is set.  If creating a shared library, produce a PIC PLT entry.
187         Only mark a PLT symbol as undefined if it was not defined by a
188         regular object file.  Create a GOT entry if got_offset is set.
189         Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set.
190         (elf_i386_finish_dynamic_sections): Change the handling of
191         DT_RELSZ to simply subtract out the size of .rel.plt.  If creating
192         a shared library, produce PIC PLT code.
193         (elf_backend_check_relocs): Define.
194         * elf32-sparc.c (elf_sparc_howto_table): Change R_SPARC_GOT10,
195         R_SPARC_GOT22, and R_SPARC_PC10 to not warn about reloc overflow.
196         (elf32_sparc_create_dynamic_sections): If creating a shared
197         library, make sure that _GLOBAL_OFFSET_TABLE_ is added as a
198         dynamic symbol, and set the type to STT_OBJECT.  Likewise for
199         _PROCEDURE_LINKAGE_TABLE_.  Don't create .rel.bss if creating a
200         shared library.
201         (elf32_sparc_check_relocs): New function.
202         (elf32_sparc_adjust_dynamic_symbol): Don't make a PLT entry if the
203         symbol already has one.  When making a PLT entry, set plt_offset.
204         Don't create a copy reloc when creating a shared library.  Don't
205         set copy_offset, just set ELF_LINK_HASH_NEEDS_COPY.
206         (elf32_sparc_allocate_dynamic_section): Remove.
207         (elf32_sparc_size_dynamic_sections): Look through all the sections
208         rather than assuming we know their names.  Only add a DT_DEBUG
209         entry if not creating a shared library.  Add a DT_TEXTREL entry if
210         required.
211         (elf32_sparc_relocate_section): Permit undefined symbols when
212         creating a shared library.  Handle the special relocation types
213         specially.
214         (elf32_sparc_finish_dynamic_symbol): Create a PLT entry if plt_offset
215         is set.  Only mark a PLT symbol as undefined if it was not defined
216         by a regular object file.  Create a GOT entry if got_offset is
217         set.  Create a copy reloc if ELF_LINK_HASH_NEEDS_COPY is set.
218         (elf32_sparc_finish_dynamic_sections): Store dynobj in a local
219         variable.
220         (elf_backend_check_relocs): Define.
221
222 Mon Jul 25 12:21:07 1994  Stan Shebs  (shebs@andros.cygnus.com)
223
224         * configure.in (pc532mach_vec): Change to pc532machaout_vec.
225         * config.bfd (ns32k-*-netbsd*): Use ns32k-nbsd as bfd_name.
226         * Makefile.in (ALL_MACHINES): Add cpu-ns32k.o.
227         (BFD32_BACKENDS): Add aout-ns32k.o, netbsd532.o, m88kmach3.o,
228         pc532-mach.o.
229         * targets.c (pc532machaout_vec): Use instead of pc532mach_vec.
230         * config/pc532-mach.mt (DEFAULT_VECTOR): Ditto.
231         (SELECT_VECS): Remove.
232         * config/ns32k-nbsd.mt: New file, was ns32k-netbsd.mt.
233         * config/ns32k-netbsd.mt: Remove, name too long.
234
235 Fri Jul 22 11:07:14 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
236
237         * linker.c (generic_link_check_archive_element): When changing a
238         symbol to common, set the alignment.
239         (_bfd_generic_link_add_one_symbol): When creating a common symbol,
240         set the alignment.
241         * aoutx.h (aout_link_check_ar_symbols): When changing a symbol to
242         common, set the alignment.
243         (aout_link_add_symbols): Restrict the alignment of a common symbol
244         to the alignment power given by the architecture.
245         * libelf.h (struct elf_link_hash_entry): Remove align field.  Add
246         copy_offset field.
247         * elfcode.h (elf_link_add_object_symbols): Store alignment in
248         new bfd_link_hash_entry field, not in elf_link_hash_entry field.
249         (elf_link_output_extsym): Similar change when getting alignment.
250         * elf.c (_bfd_elf_link_hash_newfunc): Don't initialize align.  Do
251         initialize copy_offset.
252         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use copy_offset
253         field rather than align field.  Get alignment using bfd_log2
254         rather than switch.
255         * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
256         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use copy_offset,
257         not align.
258         * elf32-sparc.c (elf32_sparc_finish_dynamic_symbol): Likewise.
259
260         * aoutx.h (NAME(aout,some_aout_object_p)): Just check
261         STAT_FOR_EXEC, don't check MACH.
262         * m88kmach3.c (MACH): Don't define.
263         * config/i386-mach3.mt (TDEFINES): Define STAT_FOR_EXEC.
264         * config/m88k-mach3.mt (TDEFINES): Likewise.
265         * config/mips-mach3.mt (TDEFINES): Likewise.
266
267 Thu Jul 21 17:24:31 1994  Stan Shebs  (shebs@andros.cygnus.com)
268
269         * i386mach3.c: Reverted to version from before Jul 5 1994 changes.
270
271 Thu Jul 21 12:26:01 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
272
273         * reloc.c (struct reloc_howto_struct): Remove special_function1.
274         It's the wrong way to do things.
275         (HOWTO): Change accordingly.
276         (HOWTO2): Remove.
277         (_bfd_final_link_relocate): Remove references to
278         special_function1.
279         * bfd-in2.h: Rebuilt.
280         * aoutx.h (aout_link_input_section_std): Remove references to
281         special_function1.
282         (aout_link_reloc_link_order): Likewise.
283
284 Wed Jul 20 15:46:44 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
285
286         * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add rpath
287         argument.  If it is not NULL, use it to set DT_RPATH.
288         * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
289         (bfd_elf64_size_dynamic_sections): Likewise.
290         * bfd-in2.h: Rebuilt.
291
292 Sat Jul 16 21:10:39 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
293
294         * elfcode.h (elf_get_dynamic_symtab_upper_bound): If there is no
295         dynamic symtab, return error.
296
297         * libelf.h (ELF_LINK_HASH_DEFINED_WEAK): Define.
298         * elfcode.h (elf_link_add_object_symbols): If symbol is defined as
299         weak, set ELF_LINK_HASH_DEFINED_WEAK.
300         (elf_link_output_extsym): If symbol is defined as weak, mark it
301         STB_WEAK.
302
303         * libelf.h (struct bfd_elf_section_data): Add relocs field.
304         (shdr_name): Remove; unused.
305         * elfcode.h (elf_slurp_reloc_table): Rewrote to handle both REL
306         and RELA relocs.  Free up the unswapped relocs.  Permit the relocs
307         to be cached in the section_data.  Correct the reloc address.
308         (elf_slurp_reloca_table): Remove.
309         (elf_canonicalize_reloc): Rewrote.
310         (elf_link_input_bfd): Permit the relocs to be cached in the
311         section data.
312
313 Sat Jul 16 13:55:38 1994  Stan Shebs  (shebs@andros.cygnus.com)
314
315         * config.bfd (m88*-harris-cxux*): Recognize.
316         * hosts/harris.h (POSIX_UTIME, HAVE_PROCFS): Define.
317
318         * configure.host (m68*-atari-sysv4*): New host.
319         (m68*-cbm-sysv4*): Use m68kv4 instead of amix.
320         * hosts/amix.h: Remove.
321         * hosts/m68kv4.h: New file, was amix.h.
322
323 Thu Jul 14 15:12:24 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
324
325         * reloc.c (enum bfd_reloc_code_real, bfd_type, struct
326         reloc_howto_struct, reloc_howto_type, HOWTO, HOWTO2): Copied
327         changes over from bfd-in2.h so they get generated properly next
328         time someone runs "make headers".
329         * bfd-in2.h: Rebuilt.
330
331         * targets.c (netbsd532_vec, pc532mach_vec): Declare const.
332         (m88kmach3_vec): Restore deleted declaration.
333
334         * configure.in: Alphabetize target vector names.
335
336         * config/pc532mach.mh: New file.
337         (HDEPFILES, HDEFINES): Define here.
338         * config/pc532-mach.mt (HDEPFILES, HDEFINES): Deleted.
339         * config/ns32k-netbsd.mt (HDEPFILES, HDEFINES): Deleted.
340
341         Sun Jul 10 00:04:20 1994  Ian Dall  (dall@hfrd.dsto.gov.au)
342
343         * pc532-mach.c: New File. pc532-mach a.out format.
344
345         * netbsd532.c: New file. pc532-netbsd532 a.out format.
346
347         * hosts/pc532mach.h: New file. pc532-mach host support.
348
349         * cpu-ns32k.c: New file. ns32k support cpu specific code rather
350         than format specific code.
351
352         * config/pc532-mach.mt: New file. Support for pc532-mach target.
353
354         * config/ns32k-netbsd.mt: New file. Support for netbsd532 target.
355
356         * aout-ns32k.c, aout-ns32k.h: New files supporting aout format for
357         ns32k series. 
358
359         * targets.c: Add netbsd532_vec and pc532machaout_vec into
360         bfd_target_vector array. Move netbsd386_vec to alphabetic order
361         location.
362
363         * reloc.c (_bfd_final_link_relocate) Add support for
364         special_function1 in howto.
365
366         * libaout.h: add M_NS32032, M_NS32532, M_532_NETBSD entries in
367         machine_type enum.
368
369         * configure.in: add pc532mach_vec and netbsd532_vec entries.
370
371         * config.bfd: add pc532mach host entries. Use for both
372         ns32k-pc532-mach and ns32k-pc532-netbsd.
373
374         * config.bfd: it doesn't work to use i386-mach3 for ns32k*-*-mach.
375         add ns32k-pc532-mach* and ns32k-*-netbsd* entries.
376
377         * bfd-in2.h: Add ns32k specific relocations to bfd_reloc_code_real
378         enum.
379
380         * bfd-in2.h: Add special_function1 to struct howto. Change HOWTO
381         and NEWHOWTO macros to make special_function1 NULL. Neww HOWTO2
382         macro.
383
384         * bfd-in2.h: Split definition of struct reloc_howto_struct
385         and corresponding typedef into two statements.
386
387         * bfd-in2.h: Add entry bfd_arch_ns32k to bfd_architecture enum.
388
389         * archures.c: Add bfd_ns32k_arch prototype, and entry in
390         archures_init_table. 
391
392         * aoutx.h (aout_link_reloc_link_order): Allow for target dependent
393         MY_put_reloc macro. Allow for target dependent special_function1
394         to apply the relocation. 
395
396         * aoutx.h (aout_link_input_section_std): Allow for target
397         dependent determination of reloc howto. Allow for target dependent
398         special_function1 to apply the relocation.
399
400         * aoutx.h (get_reloc_upper_bound): Detect bss and return 0.
401
402         * aoutx.h (slurp_reloc_table): Detect bss and succesfully read
403         zero reloc entries.
404
405         * aoutx.h (machine_type): Add bfd_arch_ns32k case.
406
407         * aoutx.h: Stat to determine executable status if STAT_FOR_EXEC
408         is defined (not just MACH). Use fstat instead of stat and check
409         for fstat error.
410
411         * aoutx.h: Allow target dependent swap_std_reloc_{in,out}.
412
413         * aoutx.h: Allow CTORS reloc info to be in target dependent reloc
414         table.
415
416         * aout-target.h: Apply SWAP_MAGIC (if defined) after
417         swap_exec_header_in, otherwise we have magic in the wrong order.
418
419 Thu Jul 14 11:47:27 1994  Stan Shebs  (shebs@andros.cygnus.com)
420
421         * coff-sparc.c (sparccoff_vec): Have leading underscores.
422
423 Tue Jul 12 12:08:10 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
424
425         * aix386-core.c, aoutf1.h, cisco-core.c, elfcode.h, hppabsd-core.c,
426         hpux-core.c, irix-core.c, lynx-core.c, osf-core.c, ptrace-core.c,
427         rs6000-core.c, trad-core.c:  Remove SEC_ALLOC flag from .reg
428         sections, .reg sections are not allocated and contain debug
429         information only.
430         * osf-core.c (make_bfd_asection, osf_core_core_file_p):  Use
431         bfd_make_section_anyway instead of building unique section names.
432
433 Tue Jul 12 11:41:22 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
434
435         * libelf.h (bfd_elf32_swap_symbol_in): Declare.
436         (bfd_elf32_swap_symbol_out): Declare.
437         (bfd_elf64_swap_symbol_in, bfd_elf64_swap_symbol_out): Declare.
438         * elf32-hppa.c (elf32_hppa_args_hash_table_init): Correct cast.
439
440         * aout-encap.c (ARCH): Don't define.  Obsolete.
441         * aout0.c, aoutx.h, gen-aout.c, hp300bsd.c, hp300hpux.c: Likewise.
442         * i386aout.c, i386bsd.c, i386dynix.c, i386linux.c: Likewise.
443         * i386lynx.c, m68klynx.c, mipsbsd.c, netbsd386.c: Likewise.
444         * newsos3.c, sparclynx.c, sunos.c: Likewise.
445
446 Mon Jul 11 20:08:23 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
447
448         * section.c (STD_SECTION): Make the sixth argument boolean, not
449         the seventh.  From gary@tuva.pacsemi.oz.au (gary kopff).
450
451 Sun Jul 10 09:12:02 1994  D. V. Henkel-Wallace  (gumby@cygnus.com)
452
453         * aoutx.h (bfd_free_cached_info): Change name of FREE to BFCI_FREE
454         in order not to collide with LynxOS's definition of FREE in
455         /usr/include/sys/proc.h
456
457 Thu Jul  7 14:18:06 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
458
459         * reloc.c (bfd_perform_relocation): Don't clobber the relocation
460         value for coff-Intel-little or coff-Intel-big.  Hack upon hack.
461
462 Thu Jul  7 10:10:34 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
463
464         * aoutx.h (howto_table_std):  Add entry for GOT relocations
465         which are present in sun3 shared libraries, to avoid assertions
466         when reading the dynamic relocations.
467
468 Thu Jul  7 10:19:20 1994  Jeff Law  (law@snake.cs.utah.edu)
469
470         * som.h (R_HPPA_COMPLEX): Fix dumb typo. 
471
472 Wed Jul  6 19:21:57 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
473
474         * hosts/sysv4.h (qsort, strtol): Don't declare.
475
476         * elfcode.h (elf_link_output_sym): Don't call output_symbol_hook
477         if it is NULL.
478
479         * elf32-mips.c (mips_elf_final_write_processing): Add ignored info
480         argument to correspond to recent libelf.h change.
481
482 Wed Jul  6 00:48:57 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
483
484         * coff-alpha.c (alpha_ecoff_mkobject_hook):  New hook to
485         additionally copy object type information from the alpha file
486         header to the BFD flags.
487         (alpha_ecoff_backend_data):  Use it.
488         (ecoffalpha_little_vec):  Add DYNAMIC to object_flags.
489         * aout64.c:  Fix typo in conditional QMAGIC definition.
490
491 Wed Jul  6 00:13:17 1994  Jeff Law  (law@snake.cs.utah.edu)
492
493         * hppabsd-core.c (hppabsd_core_core_file_p): Sanity check the
494         value of clicksz to help weed out non HPPA BSD core files.
495
496 Tue Jul  5 13:26:02 1994  Stan Shebs  (shebs@andros.cygnus.com)
497
498         Mach 3 support.
499         * config.bfd (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*):
500         New targets.
501         * configure.host (i[34]86-*-mach3*, ns32k-*-mach3*): Recognize
502         "mach3" instead of "mach".
503         (m88*-*-mach3*, mips*-dec-mach3*, mips*-*-mach3*): New hosts.
504         * targets.c (m88kmach3_vec): New target vector.
505         (bfd_target_vector): Add i386mach3_vec and m88kmach3_vec, but
506         inside #if 0.
507         * aoutx.h (some_aout_object_p) [MACH]: Recognize executables by
508         checking for execute permission, instead of looking at entry
509         point.
510         * i386mach3.c: Update, define MACH, N_TXTOFF, N_TXTADDR,
511         N_SHARED_LIB, don't include aout/*.h files, etc.
512         * m88kmach3.c: New file, m88k Mach 3 target.
513         * config/m88k-mach3.mt, config/mips-mach3.mt: New files, target
514         makefile fragments.
515         * config/i386mach3.mh, config/m88kmach3.mh, config/mipsmach3.mh:
516         New files, host makefile fragments.
517         * hosts/m88kmach3.h, hosts/mipsmach3.h: New files, host definitions.
518
519 Tue Jul  5 13:56:52 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
520
521         * elfcode.h (swap_out_syms): Get alignment of common symbol from
522         st_value field of saved ELF symbol information, if there is any.
523
524 Mon Jul  4 19:13:32 1994  Jeff Law  (law@snake.cs.utah.edu)
525
526         * som.h (R_HPPA_COMPLEX): Define.
527         * elf32-hppa.h (R_HPPA_COMPLEX): Define.
528         (elf32_hppa_reloc_type): Delete R_PARISC_STUB_CALL_17.
529
530 Fri Jul  1 12:07:41 1994  Jeff Law  (law@snake.cs.utah.edu)
531
532         * Support code for enabling the new style linker for PA ELF.
533         * elfcode.h (swap_symbol_in, swap_symbol_out): Externalize.
534         (elf_compute_section_file_positions): Pass link_info to
535         the begin_write_processing hook.
536         (bfd_elf_write_object_contents): Pass NULL for new link_info
537         argument to final_write_processing hook.
538         (elf_link_output_sym): Accept new "input_section" argument for
539         the symbols's input section.  All callers changed.  Call the
540         link_output_symbol_hook if it's defined.
541         (elf_bfd_final_link): Call the final_write_processing hook if
542         it's defined.
543         * libelf.h (elf_backend_link_output_symbol_hook): Declare.
544         (elf_backend_begin_write_processing): Add new "info" argument.
545         (elf_backend_final_write_processing): Likewise.
546         * elf32-target.h (elf_backend_link_output_symbol_hook): Provide
547         a default definition.
548         (elf32_bed): Add elf_backend_link_output_symbol_hook.
549         * elf64-target.h: Likewise.
550         
551         * Major rework of the PA ELF code.  Uses the new style BFD
552         linker, major cleanups.
553         * hppa_stubs.h: Rewrite from scratch.  Much smaller and simpler.
554         * elf32-hppa.h: Delete all symbol extension related code.
555         (hppa_look_for_stubs_in_section): Delete decl.
556         (elf32_hppa_size_stubs, elf32_hppa_build_stubs): New decls.
557         * elf32-hppa.c: Symbol extension stuff moved form elf32-hppa.h
558         into elf32-hppa.c.  Do not include aout64.h.
559         (typdef hppa_stub_type): Delete.
560         (elf32_hppa_stub_name_list_struct): Delete.
561         (elf32_hppa_stub_description_struct): Delete.
562         (arg_reloc_type): Use simpler enumerations.  All references changed.
563         (arg_location, arg_reloc_relocation): Likewise.
564         (elf32_hppa_symextn_map_struct): Delete.
565         (get_symbol_value): Delete.
566         (elf32_hppa_get_sym_extn): Delete.
567         (find_stubs, new_stubs, type_of_mismatch): Delete.
568         (find_stub_by_name, add_stub_by_name): Delete.
569         (hppa_elf_stub_finish, hppa_elf_stub_reloc): Delete.
570         (hppa_elf_arg_reloc_needed): Renamed.  Simplify.
571         (hppa_elf_build_linker_stub, hppa_elf_create_stub_sec): Delete.
572         (hppa_elf_long_branch_needed_p): Delete.
573         (hppa_look_for_stubs_in_section): Delete.
574         (hppa_elf_get_section_contents): Delete.
575         (elf32_hppa_backend_symbol_processing): Delete.
576         (elf32_hppa_backend_section_processing): Delete.
577         (elf32_hppa_backend_section_from_shdr): Delete.
578         (elf32_hppa_backend_fake_sections): Delete.
579         (elf32_hppa_backend_section_from_bfd_section): Delete.
580         (NEW_INSTRUCTION): Delete.
581         (CURRENT_STUB_OFFSET): Delete.
582         (elf32_hppa_relocate_section): New function.
583         (elf32_hppa_bfd_final_link_relocate): New function.
584         (elf32_hppa_size_symext): New function.
585         (elf32_hppa_link_output_symbol_hook): New function.
586         (elf32_hppa_read_symext_info): New function.
587         (elf32_hppa_add_symbol_hook): New function.
588         (elf32_hppa_name_of_stub): New function.
589         (elf32_hppa_size_of_stub): New function.
590         (elf32_hppa_build_one_sub): New function.
591         (elf32_hppa_build_stubs): New function.
592         (elf32_hppa_size_stubs): New function.
593         (linker, stub and argument hash tables): Add appropriate
594         structures, definitions and functions to implement all three
595         hash tables.
596         (hppa_elf_relocate_insn): Don't need argument location information
597         in this function.
598         (add_entry_to_symext_chain): Accept a symbol's argument location
599         information rather than the symbol itself.  All callers changed.
600         (hppa_elf_gen_reloc_type): Simplify.
601         (hppa_elf_set_section_contents): Stub section is no longer special.
602         (hppa_elf_reloc): Greatly simplify.
603         (elf32_hppa_begin_write_processing): Accept link_info argument.
604         Handle being called from the BFD backend linker.
605         (elf32_hppa_final_write_processing): Likewise.
606         (elf_hppa_tc_make_sections): No longer call stub_finish.
607         
608 Mon Jun 27 18:07:06 1994  Steve Chamberlain  (sac@cirdan.cygnus.com)
609
610         * section.c (bfd_get_section_contents): Put in parens to get
611         precedence right.
612
613 Sun Jun 26 18:08:29 1994  Jeff Law  (law@snake.cs.utah.edu)
614
615         * libelf.h (relocate_section): New argument "output_names" added
616         to prototype.
617         * elfcode.h (elf_link_input_bfd): New argument "output_names"
618         added to prototype of relocate_section.  Pass the output symbol
619         names to relocate_section.
620         * elf32-i386.c (elf_i386_relocate_section): Use "output_names" to
621         determine the name of a local symbol.
622         * elf32-mips.c (mips_elf_relocate_section): Likewise.
623         * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
624
625 Fri Jun 24 08:15:42 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
626
627         Add Solaris BCP (the part of Solaris which allows it to run
628         SunOS4 a.out files) core file handling.
629         * aoutf1.h (external_solaris_bcp_core, swapcore_solaris_bcp):
630         New structure and its swap in function.
631         (internal_sunos_core):  New member c_data_addr, to receive the
632         start address of the data section in the core file.
633         (swapcore_sun3, swapcore_sparc, sunos4_core_file_p):  Use it.
634         (sunos4_core_file_p):  Recognize Solaris BCP core file.
635         (sunos4_core_file_matches_executable_p):  Always indicate match
636         for Solaris BCP core files.
637
638 Thu Jun 23 15:31:28 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
639
640         Preliminary support for generating shared libraries, from Eric
641         Youngdale <ericy@cais.cais.com>.
642         * elfcode.h (prep_headers): If DYNAMIC, set e_type to ET_DYN.
643         (elf_link_add_object_symbols): If generating a shared library,
644         create dynamic sections for first input BFD with the right format.
645         (elf_link_create_dynamic_sections): Don't create .interp section
646         if creating a shared library.
647         (elf_link_input_bfd): Skip dynamic sections in input file.
648         (elf_bfd_final_link): If creating a shared library, it's OK for
649         dynobj to have sections which are not SEC_IN_MEMORY.
650         * elf32-i386.c (elf_i386_size_dynamic_sections): Only set .interp
651         section if not creating a shared library.
652         * elf32-sparc.c (elf_sparc_size_dynamic_sections): Likewise.
653
654         * elfcode.h (elf_object_p): Don't set DYNAMIC just because there
655         is an SHT_DYNAMIC section.
656
657         * cf-i386lynx.c (i386coff_vec): Don't include DYNAMIC in
658         object_flags.
659         * coff-sparc.c (sparccoff_vec): Likewise.
660         * hppabsd-core.c (hppabsd_core_vec): Likewise.
661
662         * aoutx.h (NAME(aout,some_aout_object_p)): Don't set SEC_RELOC
663         just because DYNAMIC is set.
664
665 Thu Jun 23 12:53:41 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
666
667         * configure.in: Change --with-targets to --enable-targets and
668         --with-64-bit-bfd to --enable-64-bit-bfd.
669         * Makefile.in, mpw-make.in, targets.c: Change comments.
670
671 Wed Jun 22 17:59:59 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
672
673         * config.bfd (powerpc-*-elf*): New target, just like
674         powerpc-*-sysv4*.
675
676         * linker.c (FAIL): Undefine macro before defining as enum.
677
678 Wed Jun 22 10:52:47 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
679
680         * linker.c (_bfd_generic_link_add_archive_symbols): Initialize
681         pass from abfd->archive_pass, and save it there as well.
682
683         * hash.c (bfd_hash_allocate): Don't call bfd_set_error if
684         obstack_alloc returns NULL unless the size is non-zero.
685
686         * linker.c (archive_hash_allocate): Define.
687         (_bfd_generic_link_add_archive_symbols): Use archive_hash_allocate
688         rather than obstack_alloc, for clarity.
689
690         * elfcode.h (elf_get_reloc_upper_bound): Correct.
691
692         * aout64.c (BMAGIC, QMAGIC): Define if not already defined.  From
693         Peter Schauer <pes@regent.e-technik.tu-muenchen.de>.
694
695         Linux ZMAGIC support from Eric Youngdale <ericy@cais.cais.com>.
696         * libaout.h (struct aoutdata): Add field zmagic_disk_block_size.
697         * aout-target.h (MY(callback)): Only set alignment according to
698         architecture if the section sizes are aligned to that alignment,
699         for backward compatibility.
700         (MY(set_sizes)): Initialize zmagic_disk_block_size field.
701         * aoutx.h (adjust_z_magic): Set ztih if using q_magic_format.  Set
702         text section filepos to zmagic_disk_block_size if not ztih.  Use a
703         different padding algorithm if not ztih.
704         * i386linux.c (MY_text_includes_header): Don't define.
705
706         * aoutx.h (aout_link_check_ar_symbols): Just skip N_STAB and N_FN
707         symbols; don't look them up in the hash table.  From
708         ralphc@pyramid.com (Ralph Campbell).
709
710 Tue Jun 21 11:47:20 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
711
712         * coff-go32.c (go32coff_archive_p): Remove unused function.
713
714         * section.c (bfd_abs_section): Make const.
715         (bfd_abs_section_ptr, bfd_is_abs_section): Define.
716         (bfd_und_section): Make const.
717         (bfd_und_section_ptr, bfd_is_und_section): Define.
718         (bfd_com_section): Make const.
719         (bfd_com_section_ptr): Define.
720         (bfd_ind_section): Make const.
721         (bfd_ind_section_ptr, bfd_is_ind_section): Define.
722         (bfd_abs_symbol, bfd_com_symbol): Make const.
723         (bfd_und_symbol, bfd_ind_symbol): Likewise.
724         (global_syms): Cast initialization of section field.
725         (STD_SECTION): Define as const, and cast initializations.
726         * bfd-in2.h: Rebuilt.
727         * Many files: Change uses of bfd_abs_section, etc., to use
728         bfd_abs_section_ptr or bfd_is_abs_section, etc.
729
730 Mon Jun 20 11:06:27 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
731
732         * Many files: change all bfd_target vectors to be const.  Change
733         all uses of bfd_target * to be const bfd_target *.  Change
734         bfd_target_vector and bfd_default_vector arrays to be const
735         bfd_target * const *.
736
737         * ecoff.c, libecoff.h, ecoffswap.h, coff-alpha.c, coff-mips.c,
738         elf32-mips.c: Renamed all externally visible ECOFF routines which
739         are local to BFD to start with _bfd_ecoff instead of just ecoff.
740
741         * ecoff.c (ecoff_swap_tir_in): Change input argument to const.
742         (ecoff_swap_tir_out): Likewise.
743         (ecoff_swap_rndx_in, ecoff_swap_rndx_out): Likewise.
744         (ecoff_slurp_symbolic_info): Add new arguments to correspond to
745         read_debug_info entry point in ecoff_debug_swap structure.
746         Change all calls.
747         * libecoff.h (ecoff_slurp_symbolic_info): Change declaration.
748         * ecoffswap.h (ecoff_swap_tir_in, ecoff_swap_tir_out): Declare.
749         (ecoff_swap_rndx_in, ecoff_swap_rndx_out): Declare.
750         * coff-alpha.c (alpha_ecoff_backend_data): Initialize new
751         ecoff_debug_swap fields.
752         * coff-mips.c (mips_ecoff_backend_data): Likewise.
753         * elf32-mips.c (mips_elf_read_ecoff_info): Undefine READ.
754         (mips_elf_ecoff_debug_swap): Initialize new ecoff_debug_swap
755         fields.
756         * configure.in (bfd_elf32_bigmips_vec): Use ecoff.o and
757         ecofflink.o.
758         (bfd_elf32_littlemips_vec): Likewise.
759         (ecoff_big_vec, ecoff_little_vec): Likewise.
760         (ecoffalpha_little_vec): Likewise.
761         * Makefile.in (BFD_LIBS): Remove ecoff.o and ecofflink.o.
762         (BFD32_BACKENDS): Add ecoff.o and ecofflink.o.
763
764         * aoutx.h (NAME(aout,final_link)): Check flavour of sub, not abfd,
765         when computing reloc sizes.  From Eric Youngdale
766         <ericy@cais.cais.com>.
767         * elfcode.h (elf_bfd_final_link): Don't try to compute maximum
768         reloc count or size for a non-ELF file.
769
770         * mipsbsd.c (MY_final_link_callback): Define to avoid warning.
771
772         * hp300hpux.c (MY_final_link_callback): Define to avoid warning.
773         (BMAGIC, QMAGIC): Define; used by aoutx.h.
774         (MY(slurp_symbol_table)): Change translate_from_native_sym_flags
775         calls to use new parameters.
776
777 Fri Jun 17 14:45:32 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
778
779         * aout-target.h (MY(callback)): Set the alignments of the text,
780         data and bss sections after determining the architecture.
781
782         * sunos.c (sunos_add_one_symbol): Treat a common symbol from a
783         dynamic object as being in the .bss section of the object, rather
784         than as being undefined.
785
786 Fri Jun 17 11:16:50 1994  Jeff Law  (law@snake.cs.utah.edu)
787
788         * libhppa.h (bfd_hppa_insn2fmt, hppa_rebuild_insn): Make INLINE.
789
790         * elf32-hppa.h (elf_hppa_final_processing): Delete decl.
791
792 Thu Jun 16 23:36:23 1994  Jeff Law  (law@snake.cs.utah.edu)
793
794         * elfcode.h (elf_link_input_bfd): Don't try to read local symbols
795         if there aren't any in the input file.
796
797 Thu Jun 16 14:25:22 1994  Eric Youngdale  (ericy@cais.cais.com)
798
799         * i386linux.c: Many new functions and definitions for linker
800         support for Linux shared libraries.
801         * bfd-in.h (bfd_linux_size_dynamic_sections): Declare.
802         * bfd-in2.h: Rebuild.
803
804 Thu Jun 16 14:23:46 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
805
806         * config.bfd: If second argument is ``_'', then, instead of
807         echoing config file name, echo whether target uses leading
808         underscores on symbol names.  Add appropriate settings to
809         different cases.  Used by binutils/configure.in to set default for
810         c++filt.
811
812         * elfcode.h (elf_bfd_final_link): If trying to generate a shared
813         object, warn and return false.
814
815         * aoutx.h (NAME(aout,some_aout_object_p)): Accept BMAGIC objects
816         and treat them as OMAGIC.
817
818 Wed Jun 15 18:02:21 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
819
820         Enable sparc v9 support for release.  Note that this is still a
821         work in progress, pending release of an ABI specification.
822         * config.bfd, configure.in: Include sparc v9 elf config.
823         * elfcode.h (prep_headers): Handle sparc v9 (64 bit).
824         * reloc.c (bfd_reloc_code_real): New reloc types.
825         * elf64-sparc.c: Implement elf64-sparc target.
826         * Makefile.in, targets.c: Updated.
827
828 Wed Jun 15 01:34:07 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
829
830         * libelf.h (struct elf_obj_tdata): New field dt_needed_name.
831         (elf_dt_needed_name): New accessor macro.
832         * elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name
833         is set, use that instead of the filename for the DT_NEEDED dynamic
834         entry.
835         * elf.c (bfd_elf_set_dt_needed_name): New function.
836         * bfd-in.h (bfd_elf_set_dt_needed_name): Declare.
837         * bfd-in2.h: Rebuilt.
838
839         * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add sinterpptr
840         argument, and set it to the .interp section.
841         * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
842         (bfd_elf64_size_dynamic_sections): Likewise.
843         * bfd-in2.h: Rebuilt.
844
845         * coff-sparc.c (SWAP_OUT_RELOC_EXTRA): Define to clear the r_spare
846         field of the reloc rather than letting it be garbage.
847
848         * archive.c (bfd_slurp_armap): Recognize __.SYMDEF/ as well as
849         __.SYMDEF; the former was used in old Linux archives.  From
850         jrs@world.std.com (Rick Sladkey).
851
852         * i386linux.c (i386linux_write_object_contents): Define; like
853         MY(write_object_contents) in aout-target.h, but set MACHTYPE to
854         M_386.  From jrs@world.std.com (Rick Sladkey).
855         (MY_write_object_contents): Define.
856
857         * aoutx.h (translate_from_native_sym_flags): Treat N_SETV symbols
858         as N_DATA symbols.
859         (aout_link_add_symbols): Likewise.
860
861         * aoutx.h: Rewrite symbol duplicate elimination to use BFD hash
862         tables.
863         (struct stringtab_entry, struct stringtab_data): Remove.
864         (HASHMAXLEN, HASH_CHAR, hash, compare, log2, emit_strtab): Remove.
865         (struct strtab_hash_entry, struct strtab_hash): Define.
866         (strtab_hash_newfunc, strtab_hash_lookup): Define.
867         (stringtab_free, emit_stringtab): Define.
868         (stringtab_init, add_to_stringtab): Rewrite.
869         (NAME(aout,write_syms)): Use new stringtab code.
870         (struct aout_final_link_info, NAME(aout,final_link)): Likewise.
871         (aout_link_write_symbols, aout_link_write_other_symbol): Likewise.
872
873         * bfd-in.h (BFD_TRADITIONAL_FORMAT): Define new BFD flag to
874         request BFD to write object in the traditional format, whatever
875         that means for the particular backend.
876         * bfd-in2.h: Rebuilt.
877
878         * hash.c (bfd_hash_allocate): If obstack_alloc fails, set
879         bfd_error_no_memory.
880
881 Tue Jun 14 13:00:04 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
882
883         * libaout.h (struct aoutdata): Add q_magic_format to subformat
884         enum.
885         * aout-target.h (MY_bfd_copy_private_bfd_data): Define as function
886         if not already defined.  Copy subformat information.
887         (MY_text_includes_header): Define as 0 if not already defined.
888         (MY(backend_data)): Use MY_text_includes_header rather than 0.
889         (MY_final_link_callback): Rename from final_link_callback, and
890         define only if MY_final_link_callback is not already defined.
891         (MY_bfd_final_link): Rename use of final_link_callback to
892         MY_final_link_callback.
893         * aoutx.h (NAME(aout,some_aout_object_p)): Handle QMAGIC like
894         ZMAGIC, but set the subformat to q_magic_format.  Abort if the
895         magic number if not recognized.
896         (adjust_z_magic): Use QMAGIC if q_magic_format.
897         * i386linux.c (MY_text_includes_header): Define as 1.
898         (i386linux_bfd_final_link): New static function.
899         (MY_bfd_final_link): Define as i386linux_bfd_final_link.
900
901         * aoutx.h (translate_to_native_sym_flags): Check both section and
902         output_section against sections of abfd.
903
904         * libecoff.h (struct ecoff_link_hash_entry): Change type of
905         written from boolean to char.  Add new field small.
906         * ecoff.c (ecoff_link_hash_newfunc): Initialize written to 0
907         rather than false.  Initialize small to 0.
908         (ecoff_link_add_externals): If ECOFF type is scSUndefined, set
909         small.  If small is set, and hash table type is common, force the
910         symbol into a section named SCOMMON and change the ECOFF type from
911         scCommon to scSCommon.
912         (ecoff_link_write_external): Set written to 1 rather than true.
913         * coff-mips.c (mips_relocate_section): Correct JMPADDR reloc
914         overflow check to consider section VMA of input file.
915
916 Mon Jun 13 14:20:07 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
917
918         * aoutf1.h (aout_32_sunos4_write_object_contents): Handle a
919         machine type of 68000.
920         * aoutx.h (NAME(aout,machine_type)): Add new argument unknown.
921         Set *unknown to true if machine type is really unknown, as opposed
922         to M_UNKNOWN for the 68000.
923         (NAME(aout,set_arch_mach)): Change NAME(aout,machine_type) call
924         accordingly.
925         * libaout.h (NAME(aout,machine_type)): Add new argument to
926         prototype.
927
928 Sun Jun 12 20:21:03 1994  Jeff Law  (law@snake.cs.utah.edu)
929
930         * som.c (EXEC_AUX_ID): Define based on availablity of HPUX_AUX_ID
931         or HIUX_AUX_ID.
932         (som_begin_writing): Use EXEC_AUX_ID instead of HPUX_AUX_ID.
933         (som_write_armap): Use CPU_PA_RISC1_0 as the magic number.  Note
934         som.c is careful to always define CPU_PA_RISC1_0.
935
936 Sat Jun 11 16:32:30 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
937
938         Add weak symbols as an extension to a.out.
939         * aoutx.h (sym_in_text_section): Don't define.
940         (sym_in_data_section, sym_in_bss_section): Likewise.
941         (sym_is_undefined, sym_is_global_defn): Likewise.
942         (sym_is_debugger_info, sym_is_fortrancommon): Likewise.
943         (sym_is_absolute, sym_is_indirect): Likewise.
944         (translate_from_native_sym_flags): Rewrite for clarity.  Rearrange
945         arguments and change caller.  Handle weak symbols.
946         (translate_to_native_sym_flags): Likewise.
947         (aout_link_check_ar_symbols): Don't ignore weak symbols.  Pull
948         object in from archive if a weak defintion is found for an
949         existing undefined symbol.
950         (aout_link_add_symbols): Put all cases in switch.  Set flags of an
951         undefined symbol to 0.  Handle weak symbols.
952         (aout_link_write_symbols): Handle weak symbols.
953         (aout_link_write_other_symbol): Likewise.
954         (aout_link_input_section_std): Likewise.
955         (aout_link_input_section_ext): Likewise.
956         * sunos.c (sunos_write_dynamic_symbol): Likewise.
957
958 Fri Jun 10 13:25:13 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
959
960         * aoutx.h (NAME(aout,canonicalize_reloc)): Handle .bss section.
961         (NAME(aout,get_reloc_upper_bound)): Likewise.
962
963         * coff-i960.c (coff_i960_reloc_type_lookup): Add BFD_RELOC_CTOR.
964         * linker.c (_bfd_generic_link_write_global_symbol): Don't assume
965         the section of a common symbol is not NULL.
966
967 Wed Jun  8 23:15:53 1994  Stu Grossman  (grossman@cygnus.com)
968
969         * nlmcode.h (nlm_object_p):  Set EXEC_P and start address for GDB.
970
971 Wed Jun  8 23:57:34 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
972
973         * aoutx.h (aout_get_external_symbols): Don't try to read the
974         strings if there are no symbols.
975         (aout_link_write_other_symbol): Use the output section when
976         working out the type.
977
978 Tue Jun  7 13:25:08 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
979
980         * elfcode.h (assign_section_numbers): Put shstrtab, symtab and
981         strtab sections at end of file.  Avoids bug in some versions of
982         SVR4 strip.  From Eric Youngdale <eric@tantalus.nrl.navy.mil>.
983
984         * coffcode.h (styp_to_sec_flags): If COFF_PAGE_SIZE is defined,
985         set SEC_DEBUGGING for STYP_INFO sections.
986         (coff_compute_section_file_positions): If COFF_PAGE_SIZE is
987         defined, and D_PAGED is set, set the file position equal to the
988         section VMA modulo COFF_PAGE_SIZE.
989         * coffgen.c (coff_real_object_p): If F_EXEC is set, set D_PAGED.
990         * coff-i386.c: Set D_PAGED in BFD target.
991         (COFF_PAGE_SIZE): Define.
992         * coff-m68k.c, coff-sparc.c: Likewise.
993
994 Mon Jun  6 10:57:28 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
995
996         * elfcode.h (bfd_section_from_shdr): Don't turn a reloc section
997         into a BFD section just because SHF_ALLOC is set; require that it
998         not use the normal symbol table.
999         (elf_section_from_bfd_section): Corresponding change.
1000
1001         Better indirect and warning symbol handling inspired by Stuart
1002         Quick <stuck@cs.man.ac.uk>.
1003         * linker.c (enum link_action): Add REF, MIND, CWARN, REFC.
1004         (link_action): Change UNDEF_ROW/def and UNDEFW_ROW/def from NOACT
1005         to REF.  Change UNDEF_ROW/indr and UNDEFW_ROW/indr from CYCLE to
1006         REFC.  Change DEF_ROW/indr and COMMON_ROW/indr from CYCLE to MDEF.
1007         Change DEFW_ROW/indr from CYCLE to NOACT.  Change INDR_ROW/indr
1008         from MDEF to MIND.  Change INDR_ROW/warn from WARNC to CYCLE.
1009         Change WARN_ROW/def and WARN_ROW/indr from MWARN to CWARN.  Change
1010         WARN_ROW/com from MWARN to WARN.  Change WARN_ROW/warn from NOACT
1011         to CYCLE.  Change SET_ROW/warn from WARNC to CYCLE>
1012         (_bfd_generic_link_add_one_symbol): Handle REF, MIND, CWARN and
1013         REFC.  If a new indirect symbol has been referenced, push the
1014         reference down to the symbol it points to.  FIx handling of WARN.
1015         * aoutx.h (translate_from_native_sym_flags): If N_WARNING, don't
1016         clobber e_type of next symbol.
1017         (translate_to_native_sym_flags): Likewise.
1018         (aout_link_write_symbols): Loop on bfd_link_hash_warning as well
1019         as bfd_link_hash_indirect.
1020
1021         * libaout.h (struct aout_link_hash_entry): New field written.
1022         * aoutx.h (NAME(aout,link_hash_newfunc)): Initialize written.
1023         (aout_link_write_symbols): Use written, not root.written.
1024         (aout_link_write_other_symbol): Likewise.
1025         * sunos.c (sunos_scan_dynamic_symbol): Likewise.
1026         * libecoff.h (struct ecoff_link_hash_entry): New field written.
1027         * ecoff.c (ecoff_link_hash_newfunc): Initialize written.
1028         (ecoff_link_write_external): use written, not root.written.
1029         * genlink.h (struct generic_link_hash_entry): New field written.
1030         * linker.c (_bfd_link_hash_newfunc): Don't initialize written.
1031         (generic_link_hash_newfunc): Initialize written.
1032         (_bfd_generic_link_output_symbols): Use written, not root.written.
1033         (_bfd_generic_link_write_global_symbol): Likewise.
1034         (_bfd_generic_reloc_link_order): Likewise.
1035
1036         * libecoff.h (ecoff_data_type): Add linker field.
1037         * ecoff.c (ecoff_write_object_contents): Check new tdata linker
1038         field, rather than outsymbols being non-NULL, to decide whether to
1039         output the symbols and relocs.
1040         (ecoff_bfd_final_link): Set new tdata linker field to true.
1041
1042         * ecoff.c (ecoff_bfd_copy_private_bfd_data): Don't try to copy
1043         data to a non-ECOFF file.
1044
1045         * libbfd-in.h: Add warning that libbfd.h is a generated file.
1046         * libbfd.h: Rebuilt.
1047
1048 Sun Jun  5 15:02:30 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1049
1050         Changes to support ELF strip and objcopy on dynamically linked
1051         files.
1052         * elfcode.h (elf_fake_sections): Add prototype.
1053         (bfd_section_from_shdr): Make a BFD section from an SHT_HASH
1054         section, and from an SHT_DYNSYM section, and from the dynamic
1055         string table section.
1056         (elf_object_p): Set D_PAGED if there is a program header.
1057         (elf_make_sections): Remove.
1058         (fix_up_strtabs): Remove.
1059         (elf_fake_sections): Rewrite.  Now sets sh_entsize.
1060         (assign_section_numbers): Rewrite.  Now sets sh_link and sh_info
1061         for all sections.
1062         (elf_compute_section_file_positions):  Don't call obsolete
1063         functions elf_make_sections or fix_up_strtabs.
1064         (swap_out_syms): Set sh_addralign to FILE_ALIGN rather than 4.
1065         (NAME(bfd_elf,write_object_contents)): Permit writing DYNAMIC
1066         objects.
1067         (elf_section_from_bfd_section): Treat SHT_DYNSYM like other normal
1068         sections.  If an SHT_REL or SHT_RELA section is allocated or uses
1069         an unusual symbol table, permit a BFD section to map to it.
1070         Permit most SHT_STRTAB sections to have a BFD section mapped to
1071         them.
1072         (elf_bfd_final_link): Don't set sh_link, sh_info or sh_entsize
1073         fields of dynamic sections here; do it in assign_section_numbers.
1074         * elf32-target.h, elf64-target.h: Add D_PAGED to permitted object
1075         flags.
1076
1077         * elf.c (_bfd_elf_make_section_from_shdr): Only set SEC_DATA if
1078         SEC_LOAD is set, rather than checking SEC_ALLOC.
1079
1080         * libbfd-in.h (bfd_realloc): Change last arg to "size_t size".
1081
1082 Fri Jun  3 10:58:02 1994  Jeff Law  (law@snake.cs.utah.edu)
1083
1084         * som.c (som_write_object_contents): Don't compute the file header's
1085         checksum here.
1086         (som_write_headers): Instead do it here.
1087
1088         * libbfd.h (bfd_realloc): Change last arg to "size_t size".
1089
1090 Thu Jun  2 17:39:22 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1091
1092         * hosts/sun3.h: Include <stdlib.h>.  Don't declare free, exit or
1093         getenv.
1094
1095         Add linker support for SunOS shared libraries.
1096         * sunos.c: Include bfdlink.h.  Add many new functions and
1097         definitions for SunOS shared library support.
1098         * bfd-in.h (bfd_sunos_record_link_assignment): Declare.
1099         (bfd_sunos_size_dynamic_sections): Declare.
1100         * bfd-in2.h: Rebuilt.
1101         * aoutx.h (struct aout_link_hash_entry): Move to libaout.h.
1102         (struct aout_link_hash_table): Likewise.
1103         (aout_link_hash_lookup, aout_link_hash_traverse): Likewise.
1104         (aout_hash_table): Likewise.
1105         (NAME(aout,link_hash_newfunc)): Rename from aout_link_hash_newfunc
1106         and make externally visible.
1107         (NAME(aout,link_hash_table_init)): New function.
1108         (NAME(aout,link_hash_table_create)): Call
1109         NAME(aout,link_hash_table_init), not _bfd_link_hash_table_init.
1110         (aout_link_add_symbols): Don't fail if no symbols.  If it exists,
1111         call add_dynamic_symbols backend entry point for dynamic objects.
1112         Use add_one_symbol backend entry point if it exists.
1113         (NAME(aout,final_link)): Call finish_dynamic_link backend entry
1114         point, if it exists.
1115         (aout_link_input_bfd): For a dynamic object, call
1116         link_dynamic_object backend entry point, if it exists.
1117         (aout_link_write_other_symbol): Call write_dynamic_symbol backend
1118         entry point, if it exists.
1119         (aout_link_input_section): Don't read the relocs if they have
1120         already been read.
1121         (aout_link_input_section_std): When doing a final link, for a
1122         reloc against an external symbol, call check_dynamic_reloc backend
1123         entry point, if it exists.
1124         (aout_link_input_section_ext): Likewise.
1125         * libaout.h: Protect against multiple inclusion.  Include
1126         bfdlink.h.
1127         (struct aout_link_hash_entry): Move in from aoutx.h.
1128         (struct aout_link_hash_table): Likewise.
1129         (aout_link_hash_lookup, aout_link_hash_traverse): Likewise.
1130         (aout_hash_table): Likewise.
1131         (struct aout_backend_data): Add fields add_dynamic_symbols,
1132         add_one_symbol, link_dynamic_object, write_dynamic_symbol,
1133         check_dynamic_reloc, and finish_dynamic_link.
1134         (struct aout_section_data_struct): Define new structure.
1135         (aout_section_data): Define new accessor macro.
1136         (NAME(aout,link_hash_newfunc)): Declare.
1137         (NAME(aout,link_hash_table_init)): Declare.
1138         * aoutf1.h (sunos4_aout_backend): Initialize new aout_backend_data
1139         fields.
1140         * aout-target.h (MY(backend_data)): Likewise.
1141         * i386aout.c (MY(backend_data)): Likewise.
1142         * i386mach3.c (MY(backend_data)): Likewise.
1143         * mipsbsd.c (MY(backend_data)): Likewise.
1144         * sparclynx.c (sparclynx_aout_backend): Likewise.
1145
1146         * aoutx.h (NAME(aout,slurp_symbol_table)): Don't zero out cached
1147         until we know it is non-NULL.
1148         (aout_link_write_symbols): Don't skip a warning symbol even if it
1149         has already been written out.  If skipping an indirect symbol,
1150         skip the next symbol as well.
1151
1152 Wed Jun  1 14:37:50 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1153
1154         * hosts/sun3.h: Don't declare qsort, malloc or realloc.
1155
1156 Thu May 26 13:56:03 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
1157
1158         * nlmcode.h (nlm_swap_auxiliary_headers_in): Cast bfd_byte pointer
1159         to char pointer to avoid compiler warnings.
1160
1161         * dep-in.sed: Remove spaces before colons.
1162
1163         Merged changes back in from FSF gas release 2.3:
1164
1165         * Makefile.in (stmp-bfd.h): Wrap `if' block around grep
1166         invocation, to avoid a bug in BSD 4.4 make.
1167
1168         From Ralph Campbell:
1169         * mipsbsd.c (mips_fix_jmp_addr): If symbol is undefined, return an
1170         error.
1171         (mips_fix_hi16_s): Ditto.
1172
1173         Fri May 13 21:21:00 1994  DJ Delorie (dj@ctron.com)
1174
1175         * makefile.dos: define a default target, or archives won't work
1176           due to multiple matches.
1177
1178         Wed May 11 22:32:00 1994  DJ Delorie (dj@ctron.com)
1179
1180         * configure.bat: update for latest files
1181         * makefile.dos: update for correct targets and sources
1182         * coff-go32.c: [new] go32's COFF format (i386coff with underscores)
1183         * targets.c: add go32coff target
1184         * makefile.in: add coff-go32.c support
1185
1186 Thu May 26 10:10:21 1994  Jeff Law  (law@snake.cs.utah.edu)
1187
1188         * som.c (som_prep_headers): Do not set the system_id here, private
1189         bfd data has not been copied yet.
1190         (som_write_headers): Instead do it here.
1191
1192 Tue May 24 16:17:18 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1193
1194         Make MIPS ELF use new ELF backend linker.  No shared library
1195         support yet.
1196         * elf32-mips.c (bfd_mips_elf32_swap_gptab_in): New function.
1197         (bfd_mips_elf32_swap_gptab_out): New function.
1198         (mips_elf_object_p): If last symbol is LOCAL, set elf_bad_symtab.
1199         (mips_elf_final_write_processing): Set sh_info field for .gptab.*
1200         sections.
1201         (mips_elf_fake_sections): Set sh_entsize for .gptab.* sections.
1202         (mips_elf_read_ecoff_info): Read and free external symbols last,
1203         not first, for clarity.
1204         (struct mips_elf_link_hash_entry): Define new structure.
1205         (struct mips_elf_link_hash_table): Define new structure.
1206         (mips_elf_link_hash_lookup): Define new macro.
1207         (mips_elf_link_hash_traverse): Define new macro.
1208         (mips_elf_hash_table): Define new macro.
1209         (mips_elf_link_hash_newfunc): New static function.
1210         (mips_elf_link_hash_table_create): New static function.
1211         (mips_elf_add_symbol_hook): New static function.
1212         (struct extsym_info): Define new structure.
1213         (mips_elf_get_extr, mips_elf_set_index): Remove.
1214         (mips_elf_output_extsym): New static function.
1215         (gptab_compare): New static function.
1216         (mips_elf_final_link): Rewrite to use ELF backend linker, and to
1217         merge gptab information in input files.
1218         (mips_elf_relocate_hi16): New static function.
1219         (mips_elf_relocate_section): New static function.
1220         (bfd_elf32_bfd_link_hash_table_create): Define as macro before
1221         including elf32-target.h.
1222         (elf_backend_relocate_section): Likewise.
1223         (elf_backend_add_symbol_hook): Likewise.
1224         * elf.c (_bfd_elf_link_hash_newfunc): Rename from
1225         elf_link_hash_newfunc and make globally visible.  Change caller.
1226         (_bfd_elf_link_hash_table_init): New function, broken out of
1227         _bfd_elf_link_hash_table_create.
1228         (_bfd_elf_link_hash_table_create): Use
1229         _bfd_elf_link_hash_table_init.
1230         * libelf.h (struct elf_obj_tdata): Add new field bad_symtab.
1231         (elf_bad_symtab): Define new accessor macro.
1232         (_bfd_elf_link_hash_newfunc): Declare.
1233         (_bew_elf_link_hash_table_init): Declare.
1234         * elfcode.h (elf_object_p): Call backend object_p hook after
1235         swapping in all the section headers.
1236         (map_program_segments): Correct typo: Internal for External.
1237         (elf_link_add_object_symbols): If elf_bad_symtab is set, read all
1238         the symbols.  Skip STB_LOCAL symbols rather than giving an error.
1239         (elf_bfd_final_link): If elf_bad_symtab is set, allocate space for
1240         all symbols, not just locals.
1241         (elf_link_output_extsym): Only skip a symbol not mentioned by a
1242         regular file if it is mentioned by a dynamic object.
1243         (elf_link_input_bfd): If elf_bad_symtab is set, read all the
1244         symbols.
1245
1246 Fri May 20 13:38:23 1994  Jeff Law  (law@snake.cs.utah.edu)
1247
1248         * som.c (som_set_reloc_info): Do not set any relocation info
1249         for SOM fixups which are never passed to BFD.
1250
1251 Fri May 20 11:57:05 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1252
1253         * coff-mips.c (mips_relocate_section): Add MIPS_R_JMPADDR overflow
1254         checking.
1255
1256         * elf32-i386.c (elf_i386_size_dynamic_sections): Add DT_DEBUG to
1257         the dynamic linking information for the benefit of the debugger.
1258         From Peter Schauer.
1259         * elf32-sparc.c (elf32_sparc_size_dynamic_sections): Likewise.
1260
1261         * elf.c (_bfd_elf_make_section_from_shdr): New function, based on
1262         code repeated three times in bfd_section_from_shdr in elfcode.h.
1263         * libelf.h (_bfd_elf_make_section_from_shdr): Declare.
1264         * elfcode.h (bfd_section_from_shdr): Use new function
1265         _bfd_elf_make_section_from_shdr to create BFD sections.  If a
1266         reloc section does not use the main symbol table, or it is part of
1267         the process image, treat it as a normal section, not relocs.
1268         * elf32-mips.c (mips_elf_section_from_shdr): Use new function
1269         _bfd_elf_make_section_from_shdr.
1270
1271 Thu May 19 11:37:11 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1272
1273         * elf32-target.h, elf64-target.h: Change ar_max_namelen value from
1274         15 to 14 to match SVR4 ar.
1275
1276         Add support for ELF shared libraries.  Loosely based on work by
1277         Eric Youngdale <ericy@cais.com>.
1278         * libelf.h (struct elf_backend_data): Add new fields for dynamic
1279         linking: elf_backend_create_dynamic_sections,
1280         elf_backend_adjust_dynamic_symbol,
1281         elf_backend_size_dynamic_sections,
1282         elf_backend_finish_dynamic_symbol,
1283         elf_backend_finish_dynamic_sections.
1284         (struct elf_link_hash_entry): Change type of align field to
1285         bfd_size_type.  Add fields dynindx, dynstr_index, weakdef,
1286         elf_link_hash_flags.
1287         (struct elf_link_hash_table): Add fields dynobj, dynsymcount,
1288         dynstr, bucketcount.
1289         (bfd_elf32_swap_reloc_in, bfd_elf32_swap_reloc_out): Declare.
1290         (bfd_elf32_swap_reloca_in, bfd_elf32_swap_reloca_out): Declare.
1291         (bfd_elf32_swap_dyn_in, bfd_elf32_swap_dyn_out): Declare.
1292         (bfd_elf32_add_dynamic_entry): Declare.
1293         (bfd_elf64_swap_reloc_in, bfd_elf64_swap_reloc_out): Declare.
1294         (bfd_elf64_swap_reloca_in, bfd_elf64_swap_reloca_out): Declare.
1295         (bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out): Declare.
1296         (bfd_elf64_add_dynamic_entry): Declare.
1297         * elfcode.h (Elf_External_Dyn): Define.
1298         (elf_swap_reloc_in): Define as macro using NAME.  Make externally
1299         visible.
1300         (elf_swap_reloc_out): Likewise.
1301         (elf_swap_reloca_in, elf_swap_reloca_out): Likewise.
1302         (elf_swap_dyn_in, elf_swap_dyn_out): Define as macro using NAME
1303         and as new externally visible function.
1304         (elf_fake_sections): Set section type of dynamic sections based on
1305         section names.
1306         (elf_write_phdrs): Remove.
1307         (assign_file_position_for_section): Add new align argument.
1308         Change all callers.
1309         (get_program_header_size): New static function.
1310         (struct seg_info): Remove.
1311         (map_program_segments): Completely rewrite.
1312         (assign_file_positions_except_relocs): Completely rewrite.
1313         (assign_file_positions_for_relocs): Don't set a file position for
1314         sections which already have one.  Don't bother to align the file
1315         position here.
1316         (section_from_elf_index): Handle SHT_HASH and SHT_DYNAMIC
1317         section types.
1318         (elf_section_from_bfd_section): Likewise.
1319         (elf_slurp_symbol_table): If section_from_elf_index fails, just
1320         use bfd_abs_section rather than returning an error.
1321         (elf_sizeof_headers): Make useful.
1322         (elf_link_record_dynamic_symbol): New static function.
1323         (elf_link_add_object_symbols): Handle dynamic objects.
1324         (elf_link_create_dynamic_sections): New static function.
1325         (elf_add_dynamic_entry): Define as macro using NAME and as new
1326         externally visible function.
1327         (NAME(bfd_elf,record_link_assignment)): New function.
1328         (elf_buckets): New static variable.
1329         (NAME(bfd_elf,size_dynamic_sections)): New function.
1330         (struct elf_final_link_info): Add dynsym_sec and hash_sec fields.
1331         (elf_bfd_final_link): Handle dynamic linking.  Create a section
1332         symbol for all ELF sections, not all BFD sections.  Store section
1333         symbol index in target_index field, not index field.  Traverse
1334         over global symbols even if stripping.
1335         (elf_link_output_extsym): Output dynamic symbols.  Mark symbols
1336         defined by dynamic objects as undefined.
1337         (elf_link_input_bfd): Ignore dynamic objects.  Use target_index
1338         field for section relocs, and make sure it is set.
1339         (elf_reloc_link_order): Use target_index field for section relocs,
1340         and make sure it is set.
1341         * elf.c (elf_link_hash_newfunc): Initialize dynindx, dynstr_index,
1342         weakdef and elf_link_hash_flags fields.
1343         (_bfd_elf_link_hash_table_create): Initialize dynobj, dynsymcount,
1344         dynstr and bucketcount fields.
1345         * elf32-target.h: Initialize new dynamic linking fields.
1346         * elf64-target.h: Likewise.  
1347         * elf32-i386.c: New functions for dynamic linking support.
1348         * elf32-sparc.c: Likewise.
1349         * bfd-in.h (bfd_elf32_record_link_assignment): Declare.
1350         (bfd_elf64_record_link_assignment): Declare.
1351         (bfd_elf32_size_dynamic_sections): Declare.
1352         (bfd_elf64_size_dynamic_sections): Declare.
1353         * bfd-in2.h: Rebuilt.
1354
1355 Wed May 18 08:29:04 1994  Ian Lance Taylor  (ian@cygnus.com)
1356
1357         * som.c: Don't include <sys/dir.h> or <sys/user.h>.
1358         (som_reloc_queue_find): Call memcmp instead of bcmp.
1359         (som_bfd_reloc_type_lookup): Change first argument to bfd *.
1360         (compare_syms): Change types of arguments to const void *.
1361         (bfd_section_from_som_symbol): Removed unused local found.
1362         (som_write_armap): Add elength, map, orl_count and int arguments.
1363         (som_write_armap): Use %ld and cast to long for getuid result.
1364
1365 Wed May 18 09:09:32 1994  Jeff Law  (law@snake.cs.utah.edu)
1366
1367         * elf32-hppa.h (R_HPPA_ABS_CALL): Define.
1368         * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle absolute calls.
1369
1370         * som.h (R_HPPA_ABS_CALL): Define.
1371         * som.c (hppa_som_gen_reloc_type): Delete complex relocation types.
1372
1373 Tue May 17 19:33:12 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
1374
1375         * coff-i960.c (icoff_little_vec, icoff_big_vec): Indicate leading
1376         underscore, for compatibility with Intel tool chain (gnu960v2).
1377
1378 Mon May 16 10:09:22 1994  Jeff Law  (law@snake.cs.utah.edu)
1379
1380         * bfd-in2.h: Rebuilt.
1381
1382         * elf32-hppa.c: Change .hppa_linker_stubs to .PARISC.stubs,
1383         likewise for other PA specific sections.
1384         (hppa_elf_relocate_unwind_table): Delete unused
1385         function.
1386         (elf_hppa_howto_table): Completely new table based on 94-02-02
1387         draft PA ELF spec.  Change relocation tags appropriately
1388         throughout elf32-hppa.c
1389         (hppa_elf_gen_reloc_type): Rewrite and simplify based on 94-02-02
1390         spec.
1391         (hppa_elf_reloc): Likewise.
1392         (hppa_look_for_stubs_in_section): Likewise
1393         (ELF_MACHINE_CODE): Change to EM_PARISC.
1394         * elf32-hppa.h: Include "elf/hppa.h".  Change relocation tags 
1395         appropriately throughout elf32-hppa.h.
1396         (elf32_hppa_reloc_type): New table based on 94-02-02 draft PA ELF
1397         spec.
1398         (R_HPPA_ABS_CALL, R_HPPA_COMPLEX*, R_HPPA_UNWIND): Delete definitions.
1399         * elfcode.h (prep_headers): Use EM_PARISC instead of EM_HPPA.
1400         * reloc.c (bfd_reloc_code_real): Delete unused HPPA relocations.
1401         * som.h (R_HPPA_ABS_CALL, R_HPPA_COMPLEX): Delete definitions.
1402
1403         * libhppa.h (hppa_field_adjust): Avoid adding constant_value into
1404         the final value twice for LR and RR field selectors.
1405
1406 Sat May 14 09:09:19 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
1407
1408         * aoutx.h (add_to_stringtab): Use BFD_ASSERT not assert.  This
1409         avoids __eprintf troubles.
1410
1411 Fri May 13 10:51:21 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1412
1413         * bout.c (b_out_bfd_reloc_type_lookup): Handle BFD_RELOC_CTOR.
1414
1415         * config/mipsbelf.mt (SELECT_VECS): Add ecoff_big_vec and
1416         ecoff_little_vec since Irix 5 supports ECOFF executables.
1417
1418 Wed May 11 00:31:57 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1419
1420         * ecoff.c (ecoff_find_nearest_line): Handle fdr.adr != pdr.adr
1421         correctly.
1422
1423         * Makefile.in (stmp-bfd.h): Use || instead of ; to force SunOS
1424         make to invoke the shell.
1425
1426 Tue May 10 14:23:43 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1427
1428         * section.c (SEC_COFF_SHARED_LIBRARY): Renamed from
1429         SEC_SHARED_LIBRARY for clarity.  Changed all uses.
1430         * bfd-in2.h: Rebuilt.
1431         * coffcode.h (sec_to_styp_flags): If SEC_COFF_SHARED_LIBRARY is
1432         set, set STYP_NOLOAD.
1433         * coffgen.c (coff_section_from_bfd_index): Don't get an assertion
1434         failure because of a bad shared library.
1435
1436 Mon May  9 18:53:40 1994  Bill Cox  (bill@rtl.cygnus.com)
1437
1438         * linker.c: Add missing comment terminator.
1439
1440 Mon May  9 11:53:54 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1441
1442         * linker.c (_bfd_generic_link_add_one_symbol): If hashp and *hashp
1443         are not NULL, assume the caller has already looked up the symbol
1444         in the hash table and has stored the entry in *hashp.
1445         (generic_link_add_symbol_list): Set h to NULL before calling
1446         _bfd_generic_link_add_one_symbol.
1447         * ecoff.c (ecoff_link_add_externals): Likewise.
1448
1449         * elfcode.h (assign_file_positions_except_relocs): Don't require
1450         page shared between .data and .bss segments to contain zeroes.
1451
1452         * elfcode.h: Include bfdlink.h.  Added several new functions to do
1453         linking.
1454         (ELF_R_TYPE): Define.
1455         (bfd_add_to_strtab): Return unsigned long.  Change check for
1456         realloc failure.
1457         (elf_fake_sections): Check return value of bfd_add_to_strtab.
1458         (elf_compute_section_file_positions): Add link_info argument.
1459         Call elf_backend_begin_write_processing hook and prep_headers
1460         here.  Only call swap_out_syms if link_info is NULL.  Set up
1461         .shstrtab section here.  Pass dosyms argument to
1462         assign_file_positions_except_relocs.  Set output_has_begun flag.
1463         (assign_file_positions_for_symtab_and_strtabs): Add dosyms
1464         argument, and use it to control setting .symtab and .strtab file
1465         positions.
1466         (assign_file_positions_except_relocs): Add dosyms argument, and
1467         pass it on.
1468         (prep_headers): Check return value of bfd_add_to_strtab.
1469         (swap_out_syms): Likewise.  Also, don't set up .shstrtab here.
1470         (NAME(bfd_elf,write_object_contents)): Some calls moved into
1471         elf_compute_section_file_positions.
1472         (elf_set_section_contents): Likewise.
1473         (elf_slurp_symbol_table): SHN_LORESERV corrected to SHN_LORESERVE.
1474         * libelf.h: Include bfdlink.h.
1475         (struct elf_backend_data): Add fields collect,
1476         elf_add_symbol_hook, elf_backend_relocate_section.
1477         (struct bfd_elf_section_data): Add field rel_hashes.
1478         (struct elf_obj_tdata): Remove fields internal_syms and symbols.
1479         Add field sym_hashes.
1480         (obj_symbols, obj_internal_syms): Remove definitions.
1481         (elf_sym_hashes): Define.
1482         (struct elf_link_hash_entry): Define.
1483         (struct elf_link_hash_table): Define.
1484         (elf_link_hash_lookup): Define.
1485         (elf_link_hash_traverse): Define.
1486         (elf_hash_table): Define.
1487         (_bfd_elf_link_hash_table_create): Declare.
1488         (bfd_elf32_bfd_link_add_symbols): Declare.
1489         (bfd_elf32_bfd_final_link): Declare.
1490         (bfd_elf64_bfd_link_add_symbols): Declare.
1491         (bfd_elf64_bfd_final_link): Declare.
1492         * elf.c: Include bfdlink.h.
1493         (elf_link_hash_newfunc): New function.
1494         (_bfd_elf_link_hash_table_create): New function.
1495         * elf32-target.h (elf_backend_relocate_section): If not defined,
1496         define as 0 and use generic linker.  Otherwise, use ELF backend
1497         linker.
1498         (elf_backend_collect): If not defined, define as false.
1499         (elf_backend_add_symbol_hook): If not defined, define as 0.
1500         (elf32_bed): Initialize new fields.
1501         * elf64-target.h: Same changes as elf32-target.h.
1502         * elf32-i386.c: Include bfdlink.h.
1503         (elf_i386_relocate_section): New function.
1504         (elf_backend_relocate_section): Define.
1505         * elf32-sparc.c: Include bfdlink.h.
1506         (elf_info_to_howto): Change type of dst from Elf32_Internal_Rela
1507         to Elf_Internal_Rela (they're the same type anyhow).
1508         (elf_sparc_relocate_section): New function.
1509         (elf_backend_relocate_section): Define.
1510         * elf32-mips.c (elf_backend_collect): Define.
1511
1512         * Makefile.in (stmp-bfd.h): Avoid useless make error message in a
1513         different way; touch takes a numeric argument on some systems.
1514
1515 Fri May  6 13:34:14 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1516
1517         * nlmcode.h (nlm_swap_auxiliary_headers_in): Rework custom header
1518         handling for latest suggested format.
1519         (nlm_swap_auxiliary_headers_out): Likewise.
1520         (nlm_compute_section_file_positions): Likewise.
1521
1522 Fri May  6 11:11:50 1994  D. V. Henkel-Wallace  (gumby@rtl.cygnus.com)
1523
1524         * config.bfd: handle erricsson config (for OSE).
1525
1526 Thu May  5 15:40:47 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
1527
1528         Patches from Ralph Campbell:
1529         * mipsbsd.c (mips_fix_jmp_addr): New function.
1530         (mips_fix_hi16_s): Use bfd_is_com_section.
1531         (mips_howto_table_ext): Call mips_fix_jmp_addr for MIPS_RELOC_JMP.
1532
1533 Fri May  6 11:48:55 1994  Steve Chamberlain  (sac@cygnus.com)
1534
1535         * config/go32.mh: XX support.
1536
1537         From bill
1538         * Makefile.in: Build sysdep.h without causing worrying but
1539         harmless error message.
1540
1541 Wed May  4 11:09:53 1994  Ian Lance Taylor  (ian@cygnus.com)
1542
1543         Changed m68k-aout to set flags to 0; m68k-sunos still uses 1.
1544         * aout0.c: New file.
1545         * targets.c (aout0_big_vec): Declare.
1546         (bfd_target_vector): Add aout0_big_vec.
1547         * config.bfd (m68*-*-aout*): Use m68k-0aout, not m68k-aout.
1548         * config/m68k-aout.mt (SELECT_VECS): Removed.
1549         * config/m68k-0aout.mt: New file.
1550         * configure.in (aout0_big_vec): New target vector: use aout0.o,
1551         aout32.o and stab-syms.o.
1552         * Makefile.in: Rebuilt dependencies.
1553         (BFD32_BACKENDS): Add aout0.o.
1554         (CFILES): Add aout0.c.
1555
1556         * libaout.h (struct aout_backend_data): Add field exec_hdr_flags.
1557         * aout-target.h (MY_exec_hdr_flags): If not defined, define as 0.
1558         MY(backend_data): Initialize exec_hdr_flags field.
1559         * aoutf1.h (sunos_32_set_arch_mach): Make static.
1560         (aout32_sunos4_write_object_contents): Set flags from backend
1561         info.
1562         (MY_exec_hdr_flags): If not defined, define as 1.
1563         (sunos4_aout_backend): Initialize exec_hdr_flags field.
1564         * aout-encap.c (encap_write_object_contents): Set flags from
1565         backend info.
1566         (MY_exec_hdr_flags): Define as N_FLAGS_COFF_ENCAPSULATE.
1567         * hp300hpux.c (MY_exec_hdr_flags): Define as 0x2.
1568         (MY(write_object_contents)): Set flags from backend info.
1569         * i386aout.c (MY(backend_data)): Initialize exec_hdr_flags field.
1570         * i386mach3.c (MY(backend_data)): Likewise.
1571         * mipsbsd.c (MY(backend_data)): Likewise.
1572         * sparclynx.c (NAME(aout,sparclynx_write_object_contents)): Set
1573         flags from backend info.
1574         (sparclynx_aout_backend): Initialize exec_hdr_flags field.
1575
1576 Wed May  4 02:56:00 1994  Ken Raeburn  (raeburn@kr-pc.cygnus.com)
1577
1578         * config.bfd (i386-*-gnu*): Treat like i386-*-mach*.
1579         (m68*-apollo-*): Treat all Apollo configs the same, don't handle
1580         BSD specially.
1581
1582 Tue May  3 19:43:21 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1583
1584         * cache.c: Rewrote to work correctly.
1585         * libbfd.h: Rebuilt.
1586         * opncls.c (bfd_cache_init, bfd_open_file): Don't declare.
1587         (bfd_fdopenr): Check return value of bfd_cache_init.
1588
1589 Fri Apr 29 15:08:23 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1590
1591         * cf-m68klynx.c (CALC_ADDEND): Check for PC relative relocs by
1592         enumerating them, since the reloc type can not serve as an index
1593         into the m68k COFF howto_table.
1594
1595 Fri Apr 29 09:42:39 1994  Steve Chamberlain  (sac@cygnus.com)
1596
1597         * config.bfd (*-go32): Changed to coff.
1598         * coff-h8300.c (JMPL1): Get HOWTO right for 24bit branches.
1599         * srec.c (srec_write_symbols): Write out the correct number of
1600         symbols and don't stick in extra nulls.
1601
1602 Tue Apr 26 15:07:24 1994  Stan Shebs  (shebs@andros.cygnus.com)
1603
1604         * cf-sparclynx.c (LYNXOS, COFF_LONG_FILENAMES): Define.
1605         * coff-sparc.c (BADMAG): Recognize LYNXCOFFMAGIC.
1606         (COFF_SPARC): Define.
1607         * coffcode.h (coff_new_section_hook): If COFF_SPARC, set alignment
1608         power of data and bss sections to 3.
1609         * hosts/lynx.h (__LYNXOS): Define.
1610
1611 Tue Apr 26 15:04:26 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
1612
1613         * elf32-hppa.c (hppa_elf_reloc): Adjust the addend of relocations
1614         against section symbols to avoid losing during ld -r.
1615
1616 Tue Apr 26 12:16:41 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1617
1618         * elfcode.h (shstrtab_length_fixed): Remove useless static
1619         variable.
1620         (struct elf_sect_data): Remove unused structure.
1621         (elf_object_p): Free memory if error occurs.  Check return value
1622         of bfd_default_set_arch_mach.  If elf_get_str_section fails,
1623         preserve error code rather than setting wrong_format.
1624         (null_shdr): Remove static variable.
1625         (assign_section_numbers): Remove shstrtab_length_fixed assignment.
1626         Allocate first section header on BFD obstack rather than using
1627         null_shdr.
1628         (bfd_prpsinfo): Remove unused local variable newsect.
1629
1630 Mon Apr 25 15:31:04 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1631
1632         * elfcode.h (write_relocs): Undo patch of Apr 10; breaks Solaris.
1633
1634         * elfcode.h (bfd_section_from_shdr): Use bfd_make_section_anyway
1635         to create sections.  Check return value of recursive calls.
1636         (bfd_section_from_phdr): Check return value of bfd_make_section.
1637         (elf_symbol_from_bfd_symbol): Likewise.
1638         (elf_object_p): Check return value of bfd_section_from_shdr.
1639         (section_from_elf_index): Likewise.
1640         (elf_slurp_symbol_table): Check return value of
1641         section_from_elf_index.
1642         (bfd_prstatus): Return boolean value.  Check return value of
1643         bfd_make_section.
1644         (bfd_fpregset): Likewise.
1645         (bfd_prpsinfo): Return boolean value.
1646         (elf_corefile_note): Check return values of bfd_prstatus,
1647         bfd_fpregset, and bfd_prpsinfo.
1648         (elf_core_file_p): Check return value of elf_corefile_note.
1649
1650 Fri Apr 22 11:08:38 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1651
1652         Get rid of the ECOFF .reginfo section hack.
1653         * ecoff.c (ecoff_mkobject_hook): Don't create a .reginfo section.
1654         (ecoff_new_section_hook): Don't handle the .reginfo section.
1655         (ecoff_sizeof_headers): Likewise.
1656         (ecoff_get_section_contents): Likewise.
1657         (ecoff_compute_section_file_positions): Likewise.
1658         (ecoff_compute_reloc_file_positions): Likewise.
1659         (ecoff_set_section_contents): Likewise.
1660         (ecoff_write_object_contents): Likewise.
1661         (ecoff_bfd_final_link): Likewise.
1662         (ecoff_bfd_copy_private_bfd_data): Copy the GP value and the
1663         register masks.
1664         (bfd_ecoff_get_gp_value): New function.
1665         (bfd_ecoff_set_gp_value): New function.
1666         (bfd_ecoff_set_regmasks): New function.
1667         * bfd-in.h (bfd_ecoff_get_gp_value): Declare.
1668         (bfd_ecoff_set_gp_value): Declare.
1669         (bfd_ecoff_set_regmasks): Declare.
1670         * bfd-in2.h: Rebuilt.
1671
1672         Fix ECOFF objcopy to actually copy debugging information.
1673         * ecoff.c (ecoff_bfd_copy_private_bfd_data): New function.
1674         (ecoff_get_extr): Assume that any ECOFF symbol with local clear is
1675         an external symbol, rather than checking the symbol flags.  Only
1676         check the flags for non-ECOFF symbols.
1677         * ecofflink.c (bfd_ecoff_debug_externals): Don't crash if the
1678         output_section field of the symbol section is NULL.
1679         * libecoff.h (ecoff_bfd_copy_private_bfd_data): Declare as
1680         function rather than defining as macro.
1681
1682         * ieee.c (ieee_object_p): Set bfd_error_got_wrong_format if
1683         appropriate.
1684
1685         * targets.c (bfd_target_vector): Add bfd_elf32_powerpc_vec.
1686
1687         * aout-adobe.c (aout_adobe_set_arch_mach): Check return value of
1688         bfd_default_set_arch_mach.  Accept bfd_arch_m68k as well as
1689         bfd_arch_unknown.
1690         * coffcode.h (coff_set_arch_mach): Check return value of
1691         bfd_default_set_arch_mach.
1692         * elfcode.h (elf_set_arch_mach): Don't check a list of ELF
1693         architectures, just see if the desired architecture matches what
1694         the ELF backend permits.
1695
1696         * coffcode.h (coff_set_arch_mach_hook): Rename SHMAGIC to
1697         SH_ARCH_MAGIC to match change in coff/sh.h.
1698         (coff_set_flags): Likewise.
1699
1700         Follow convention in which each NLM header has an 8 byte stamp
1701         followed by a four byte length.
1702         * libnlm.h (struct nlm_obj_tdata): Rename nlm_cygnus_section_hdr
1703         to nlm_cygnus_ext_header, and change type to
1704         Nlm_Internal_Cygnus_Ext_Header.
1705         (nlm_cygnus_ext_header): Rename from nlm_cygnus_section_header.
1706         * nlmcode.h (nlm_swap_auxiliary_headers_in): Use CyGnUsEx instead
1707         of CyGnUsSeCs.  Rename from cygnus_section to cygnus_ext.  Require
1708         length word to be 8.
1709         (nlm_swap_auxiliary_headers_out): Rename from cygnus_section to
1710         cygnus_ext.  Set length word to 8.
1711         (nlm_compute_section_file_positions): Rename from cygnus_section
1712         to cygnus_ext.
1713
1714 Thu Apr 21 22:54:22 1994  Stu Grossman  (grossman at cygnus.com)
1715
1716         * nlmcode.h (nlm_swap_auxiliary_headers_in):  Keep section table
1717         (from CyGnUsSeCs) in more permanent memory to keep section names
1718         from getting trashed.
1719
1720 Thu Apr 21 09:29:37 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
1721
1722         * libelf.h (elf_obj_tdata):  Add members for dynamic symbol table
1723         handling.
1724         * elfcode.h (bfd_section_from_shdr):  Handle dynamic symbol table.
1725         * elfcode.h (elf_slurp_symbol_table):  Take additional parameter
1726         to select static or dynamic symbol table and return number of
1727         symbols slurped or -1 on error.
1728         * elfcode.h (elf_get_symtab):  Set bfd symcount from
1729         elf_slurp_symbol_table result.
1730         * elfcode.h (elf_get_dynamic_symtab_upper_bound,
1731         elf_canonicalize_dynamic_symtab):  New functions to handle dynamic
1732         symbol table.
1733         * elf32-target.h, elf64-target.h (BFD_JUMP_TABLE_DYNAMIC):
1734         Change to handle dynamic symbol table, provide default definitions
1735         for dynamic relocs.
1736         * aoutx.h (howto_table_std, NAME(aout,swap_std_reloc_out),
1737         NAME(aout,swap_std_reloc_in), aout_link_input_section_std,
1738         aout_link_reloc_link_order):  Handle r_jmptable and r_relative
1739         relocations.
1740
1741 Thu Apr 21 11:58:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1742
1743         Clean up uses of _bfd_dummy_target (from Peter Schauer).
1744         * libbfd.c (_bfd_dummy_target): Set bfd_error_wrong_format.
1745         * nlm-target.h (nlm_core_file_p): Define as _bfd_dummy_target, not
1746         NULL.
1747         * srec.c (srec_vec): Use _bfd_dummy_target, not NULL, in
1748         _bfd_check_format.
1749         (symbolsrec_vec): Likewise.
1750         * tekhex.c (tekhex_vec): Likewise.
1751
1752         * libnlm.h (struct nlm_obj_tdata): Add nlm_cygnus_section_hdr
1753         field.
1754         (nlm_cygnus_section_header): New accessor macro.
1755         * nlmcode.h (nlm_object_p): Free new tdata structure if failure.
1756         Add fixed sections before swapping in auxiliary headers.  After
1757         adding sections, treat errors as real, not as wrong format.
1758         (nlm_swap_auxiliary_headers_in): Swap in the sections header; add
1759         sections to the BFD for each section it describes.
1760         (nlm_swap_auxiliary_headers_out): Swap out the sections header.
1761         (nlm_compute_section_file_positions): Account for the size of the
1762         sections header.
1763
1764 Wed Apr 20 16:45:51 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
1765
1766         * coff-sparc.c (sparccoff_vec): Change minimum alignment power to
1767         2, so that stab sections can be multiples of 4 bytes only.
1768
1769         * hosts/i386aix.h: Changes to avoid prototypes conflicts with the
1770         ones defined in stdlib.h.  (From Minh Tran-Le.)
1771
1772 Wed Apr 20 14:15:21 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1773
1774         * nlm32-ppc.c: Complete rewrite for new version of PowerPC
1775         NetWare.  Old code still present, but ifdeffed out.
1776
1777         * nlmcode.h (nlm_swap_auxiliary_headers_in): Don't assume a
1778         particular format for the customer header.  Allocate a block of
1779         memory and read it into that.
1780         (nlm_swap_auxiliary_headers_out): Write out the block of memory.
1781         (nlm_compute_section_file_positions): Include length of customer
1782         header when computing its size.
1783
1784 Mon Apr 18 14:27:17 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
1785
1786         * som.c (som_prep_headers): Get the space's number from the
1787         backend private section data rather than target_index.
1788         (bfd_som_set_section_attributes): Store the space's number
1789         in the backend private section data rather than target_index.
1790
1791         * som.h (som_copyable_section_data_struct): Add space_number.
1792
1793 Fri Apr 15 12:22:07 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1794
1795         * coff-a29k.c (reloc_processing): Always set the address of a
1796         R_IHCONST reloc to that of the immediately preceding R_IHIHALF.
1797         gas does this anyhow, but some other assemblers seem to leave
1798         garbage in the R_IHCONST address field.
1799
1800         * bfd/archive.c: Consistently use ARFMAG; from
1801         schwab@issan.informatik.uni-dortmund.de (Andreas Schwab).
1802         (_bfd_write_archive_contents): Use ARFMAG rather than '`' and
1803         '\012'.
1804         (bsd_write_armap): Likewise.
1805         (coff_write_armap): Likewise.
1806
1807         * coff-mips.c (mips_relocate_section): When relaxing, adjust local
1808         relocs against the .text section as required.
1809         * ecofflink.c (bfd_ecoff_debug_accumulate): When relaxing, adjust
1810         PDR addresses as required.
1811
1812         * ecoff.c (ecoff_emit_aggregate): Take fdr argument.  Map fdr
1813         index through rfd map if it exists.  Check for a couple of cases
1814         which gdb handles specially.  Change all callers.
1815         (ecoff_type_to_string): Take fdr argument rather than aux_ptr and
1816         bigendian argument.  Change all callers.
1817         (ecoff_print_symbol): Handle stStruct, stUnion and stEnum.
1818
1819 Thu Apr 14 13:05:10 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1820
1821         * coff-mips.c (mips_howto_table): Add dummy entries to account for
1822         numbering changes in include/coff/mips.h.  Add entries for
1823         MIPS_R_RELHI and MIPS_R_RELLO.
1824         (mips_ecoff_swap_reloc_in): Handle an extra bit for the reloc type
1825         when little endian.  Treat internal MIPS_R_RELLO or MIPS_R_RELHI
1826         relocs like MIPS_R_SWITCH, and convert r_offset from 24 to 32
1827         bits.
1828         (mips_ecoff_swap_reloc_out): Likewise.
1829         (mips_adjust_reloc_in): Handle internal MIPS_R_RELLO or
1830         MIPS_R_RELHI relocs like MIPS_R_SWITCH.
1831         (mips_adjust_reloc_out): Likewise.
1832         (mips_relhi_addr, mips_relhi_addend): New static variables.
1833         (mips_relhi_reloc, mips_rello_reloc): New functions.
1834         (mips_bfd_reloc_type_lookup): Turn BFD_RELOC_PCREL_HI16_S into
1835         MIPS_R_RELHI and turn BFD_RELOC_PCREL_LO16 into MIPS_R_RELLO.
1836         (mips_relocate_hi): Rename from mips_relocate_refhi, and add pcrel
1837         argument.  Changed all callers.
1838         (mips_relocate_section): Rename got_reflo to got_lo and
1839         reflo_int_rel to lo_int_rel.  Handle MIPS_R_RELLO and MIPS_R_RELHI
1840         relocs.
1841         (mips_relax_section): Adjust MIPS_R_RELHI/MIPS_R_RELLO pairs when
1842         expanding a PC relative call.
1843
1844         * reloc.c (bfd_reloc_code_real_type): Add BFD_RELOC_PCREL_HI16_S
1845         and BFD_RELOC_PCREL_LO16.
1846         * bfd-in2.h: Rebuilt.
1847
1848 Wed Apr 13 11:50:07 1994  Stan Shebs  (shebs@andros.cygnus.com)
1849
1850         * coff-sparc.c (sparccoff_vec): Set minimum alignment power to 3.
1851
1852 Tue Apr 12 13:36:20 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
1853
1854         * som.c (som_write_fixups): Always emit at least
1855         one relocation for any non-bss section.
1856
1857 Mon Apr 11 14:41:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1858
1859         * elfcode.h (assign_file_positions_except_relocs): Don't require
1860         the file alignment to correspond to the page size when linking
1861         with -N.
1862
1863 Sun Apr 10 01:02:24 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
1864
1865         * elfcode.h (write_relocs): For rela relocations, adjust the
1866         addend for relocations involving section symbols to account
1867         for the lossage of 1:1 mapping from input section symbols to
1868         output section symbols.
1869
1870 Fri Apr  8 12:22:02 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1871
1872         * aoutx.h (NAME(aout,make_sections)): New function.
1873         (NAME(aout,some_aout_object_p)): Call NAME(aout,make_sections)
1874         rather than making sections inline.
1875         (NAME(aout,mkobject)): Don't make any sections.
1876         (NAME(aout,adjust_sizes_and_vmas)): Call NAME(aout,make_sections).
1877         (NAME(aout,final_link)): Don't dereference obj_textsec (abfd) or
1878         obj_datasec (abfd) if they are NULL.
1879         * libaout.h (NAME(aout,make_sections)): Declare.
1880         * bout.c (b_out_mkobject): Don't make any sections.
1881         (b_out_write_object_contents): Call aout_32_make_sections.
1882         (b_out_set_section_contents): Likewise.
1883         * i386os9k.c (os9k_mkobject): Don't make any sections.
1884         (os9k_write_object_contents): Call aout_32_make_sections.
1885         (os9k_set_section_contents): Likewise.
1886
1887         * aoutx.h (NAME(aout,new_section_hook)): Don't set N_EXT in target
1888         index.
1889
1890 Wed Apr  6 20:44:56 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
1891
1892         * config.bfd, configure.host:  Add mips-*-sysv4* support.
1893
1894 Thu Apr  7 14:23:05 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1895
1896         * coff-mips.c (mips_howto_table): Add entry for MIPS_R_SWITCH.
1897         (mips_ecoff_swap_reloc_in): For MIPS_R_SWTICH, copy r_symndx into
1898         r_offset and set r_symndx to RELOC_SECTION_TEXT.
1899         (mips_ecoff_swap_reloc_out): For MIPS_R_SWITCH, get the r_symndx
1900         value from the r_offset field.
1901         (mips_adjust_reloc_in): Maximum r_type value is now MIPS_R_SWITCH.
1902         For MIPS_R_SWITCH, copy the r_offset field into the addend field.
1903         (mips_adjust_reloc_out): For MIPS_R_SWITCH, copy the addend field
1904         into the r_offset field.
1905         (mips_switch_reloc): New function.
1906         (mips_bfd_reloc_type_lookup): Translate BFD_RELOC_GPREL32 into
1907         MIPS_R_SWITCH.
1908         (mips_relocate_section): Handle MIPS_R_SWITCH.
1909         (mips_relax_section): Adjust MIPS_R_SWITCH offset if necessary.
1910
1911 Thu Apr  7 11:10:51 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
1912
1913         * elfcode.h (elf_set_section_contents): Support calling the backend
1914         function elf_backend_begin_write_processing when just beginning to
1915         write an object file.
1916
1917         * libelf.h (elf_backend_begin_write_processing): Declare.
1918
1919         * elf{32,64}-target.h (elf_backend_begin_write_processing): Provide
1920         a default definition.
1921         (elf{32,64}_bed): Add elf_backend_begin_write_processing.
1922         
1923         * elf32-hppa.h (elf_hppa_tc_symbol): Delete extern declaration.
1924         (elf_hppa_tc_make_sections): Likewise.
1925
1926         * elf32-hppa.c (symext_chain_built): Delete.
1927         (symext_chain_size): Renamed from symextn_contents_real_size.
1928         (elf32_hppa_backend_{begin,final}_write_processing): New functions.
1929         (add_entry_to_symext_chain): New function.
1930         (hppa_elf_set_section_contents): Ignore writes to the symbol extension
1931         section until it's been rebuilt internally.
1932         (hppa_elf_get_section_contents): Symbol extension section is no
1933         longer special.
1934         (elf_backend_{begin,final}_write_processing): Define.
1935         (elf_hppa_tc_make_sections): Simplify now that much code has
1936         migrated into elf32_hppa_backend_{being,final}_write_processing.
1937
1938 Wed Apr  6 17:24:14 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
1939
1940         Add new target vectors to read the dynamic symbols and dynamic
1941         relocs.  Change a.out to use these rather than reading the dynamic
1942         symbols and relocs along with the normal symbols and relocs.
1943         * targets.c (bfd_target): Add fields
1944         _bfd_get_dynamic_symtab_upper_bound,
1945         _bfd_canonicalize_dynamic_symtab,
1946         _bfd_get_dynamic_reloc_upper_bound,
1947         _bfd_canonicalize_dynamic_reloc.
1948         (BFD_JUMP_TABLE_DYNAMIC): Define.
1949         * libbfd-in.h (_bfd_nodynamic_get_dynamic_symtab_upper_bound):
1950         Define.
1951         (_bfd_nodynamic_canonicalize_dynamic_symtab): Define.
1952         (_bfd_nodynamic_get_dynamic_reloc_upper_bound): Define.
1953         (_bfd_nodynamic_canonicalize_dynamic_reloc): Define.
1954         * bfd.c (bfd_get_dynamic_symtab_upper_bound): Define.
1955         (bfd_canonicalize_dynamic_symtab): Define.
1956         (bfd_get_dynamic_reloc_upper_bound): Define.
1957         (bfd_canonicalize_dynamic_reloc): Define.
1958         * sunos.c (MY_read_dynamic_symbols): Don't define.
1959         (MY_read_dynamic_relocs): Don't define.
1960         (MY_get_dynamic_symtab_upper_bound): Define.
1961         (MY_canonicalize_dynamic_symtab): Define.
1962         (MY_get_dynamic_reloc_upper_bound): Define.
1963         (MY_canonicalize_dynamic_reloc): Define.
1964         (struct sunos_dynamic_info): Change type of dynsym_count and
1965         dynrel_count to long.  Add fields canonical_dynsym and
1966         canonical_dynrel.
1967         (sunos_read_dynamic_info): Check that BFD had DYNAMIC flag set.
1968         Clear info->canonical_dynsym and info->canonical_dynrel.
1969         (MY(read_dynamic_symbols)): Removed.
1970         (MY(read_dynamic_relocs)): Removed.
1971         (sunos_get_dynamic_symtab_upper_bound): New function.
1972         (sunos_canonicalize_dynamic_symtab): New function.
1973         (sunos_get_dynamic_reloc_upper_bound): New function.
1974         (sunos_canonicalize_dynamic_reloc): New function.
1975         * libaout.h: Declare struct reloc_ext_external and
1976         reloc_std_external to avoid prototype problems.
1977         (struct aout_backend_data): Remove fields read_dynamic_symbols and
1978         read_dynamic_relocs.
1979         (NAME(aout,translate_symbol_table)): Declare.
1980         (NAME(aout,swap_ext_reloc_in)): Declare.
1981         (NAME(aout,swap_std_reloc_in)): Declare.
1982         * aoutx.h (NAME(aout,translate_symbol_table)): Renamed from
1983         translate_symbol_table and made non-static.  Changed all callers.
1984         (NAME(aout,slurp_symbol_table)): Don't read dynamic symbols.
1985         (NAME(aout,slurp_reloc_table)): Don't read dynamic relocs.
1986         (NAME(aout,get_reloc_upper_bound)): Don't count dynamic relocs.
1987         * aoutf1.h (aout_32_sunos4_write_object_contents): Don't bother to
1988         remove dynamic symbols and relocs.  They will no longer be
1989         present.
1990         (MY_read_dynamic_symbols): Don't define.
1991         (MY_read_dynamic_relocs): Don't define.
1992         (sunos4_aout_backend): Don't initialize dynamic entry points.
1993         * aout-target.h (MY_read_dynamic_symbols): Don't define.
1994         (MY_read_dynamic_relocs): Don't define.
1995         (MY(backend_data)): Don't initialize dynamic entry points.
1996         (MY_get_dynamic_symtab_upper_bound): If not defined, define to
1997         _bfd_nodynamic version.
1998         (MY_canonicalize_dynamic_symtab): Likewise.
1999         (MY_get_dynamic_reloc_upper_bound): Likewise.
2000         (MY_canonicalize_dynamic_reloc): Likewise.
2001         * All backends: Added BFD_JUMP_TABLE_DYNAMIC to target vector.
2002         * bfd-in2.h: Rebuilt.
2003         * libbfd.h: Rebuilt.
2004
2005         * cf-m68klynx.c: Include sysdep.h.
2006
2007         * hp300hpux.c: Removed some spaces in uses of NAME to avoid
2008         problems with traditional C compilers.
2009
2010         * targets.c (bfd_target): Rearranged fields in target vector.
2011         Removed _bfd_debug_info_start, _bfd_debug_info_end and
2012         _bfd_debug_info_accumulate, which were never used.
2013         (BFD_JUMP_TABLE_GENERIC, BFD_JUMP_TABLE_COPY): Defined.
2014         (BFD_JUMP_TABLE_CORE, BFD_JUMP_TABLE_ARCHIVE): Defined.
2015         (BFD_JUMP_TABLE_SYMBOLS, BFD_JUMP_TABLE_RELOCS): Defined.
2016         (BFD_JUMP_TABLE_WRITE, BFD_JUMP_TABLE_LINK): Defined.
2017         * All backends: Changed to use the new BFD_JUMP_TABLE_* macros
2018         rather than the single JUMP_TABLE macro.  Removed many of the
2019         weird macro definitions needed to support the monolithic
2020         JUMP_TABLE.
2021         * bfd-in.h (JUMP_TABLE): Removed.
2022         * libbfd-in.h: Define a bunch of macros, and declare a few
2023         functions, for use with the new BFD_JUMP_TABLE_* macros.
2024         * libbfd.c (_bfd_dummy_new_section_hook): Removed.
2025         (bfd_false): Set bfd_error_invalid_operation.
2026         (bfd_nullvoidptr): Likewise.
2027         (bfd_n1): New function.
2028         (_bfd_nocore_core_file_matches_executable_p): Renamed from
2029         _bfd_dummy_core_file_matches_executable_p.
2030         (_bfd_nocore_core_file_failing_command): Similar rename.  Set
2031         bfd_error_invalid_operation.
2032         (_bfd_nocore_core_file_failing_signal): Likewise.
2033         (_bfd_generic_get_section_contents): Renamed from
2034         bfd_generic_get_section_contents.  Changed all callers.
2035         (_bfd_generic_set_section_contents): Similar rename.
2036         * ieee.c: #if 0 out ieee_bfd_debug_info_start,
2037         ieee_bfd_debug_info_end, ieee_bfd_debug_info_accumulate.  They
2038         were never called.
2039         * bfd-in2.h: Rebuilt.
2040         * libbfd.h: Rebuilt.
2041
2042 Tue Apr  5 22:10:04 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2043
2044         * Crude support for examining dynamic libraries.
2045         * som.c (som_object_setup): Set DYNAMIC flag for SHL_MAGIC and
2046         DL_MAGIC objects.
2047         (som_prep_headers): Preserve the system_id for DYNAMIC objects.
2048         Use SHL_MAGIC as the magic number of the DYNAMIC flag is set.
2049         Write exec headers for DYNAMIC objects.
2050         (som_begin_writing): DYNAMIC objects have the same alignment
2051         restrictions as D_PAGED objects.
2052         (bfd_section_from_som_symbol): Treat DYNAMIC objects like EXEC_P
2053         objects.
2054         (object_flags): Add DYNAMIC.
2055
2056 Tue Apr  5 17:48:52 1994  Stan Shebs  (shebs@andros.cygnus.com)
2057
2058         * i386lynx.c, sparclynx.c (NAME): Remove embedded whitespace in
2059         macro uses, confuses some non-ANSI compilers.
2060
2061 Tue Apr  5 15:50:01 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2062
2063         * som.c (som_bfd_free_cached_info): Add missing PARAMS decl.
2064         Don't free anything if we don't have a bfd_object.
2065         (som_close_and_cleanup): Call som_bfd_free_cached_info.
2066
2067 Tue Apr  5 11:22:38 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2068
2069         * elf32-mips.c (mips_elf_final_link): Don't remove empty sections.
2070         It turns out not to be required on Irix 5, and it causes problems
2071         if the sections happen to contain symbols.
2072
2073         * elfcode.h (write_shdrs_and_ehdr): Correct bfd_write check.
2074
2075         * aoutx.h (NAME(aout,canonicalize_reloc)): Don't error out if
2076         section->relocation is NULL; malloc might have returned NULL when
2077         given a zero size if there were no relocations.
2078         * bout.c (b_out_canonicalize_reloc): Likewise.
2079         * coffcode.h (coff_canonicalize_reloc): Likewise.
2080         * ecoff.c (ecoff_canonicalize_reloc): Likewise.
2081         * elfcode.h (elf_canonicalize_reloc): Likewise.
2082         * mipsbsd.c (MY(canonicalize_reloc)): Likewise.
2083         * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
2084         * nlmcode.h (nlm_canonicalize_reloc): Likewise.
2085         * som.c (som_canonicalize_reloc): Likewise.
2086         * hp300hpux.c (MY(slurp_reloc_table)): Likewise.  Also, if malloc
2087         returns NULL, don't report an error if we asked for zero bytes.
2088         * i386lynx.c (NAME(lynx,slurp_reloc_table)): If malloc returns
2089         NULL, don't report an error if we asked for zero bytes.
2090         * nlmcode.h (nlm_slurp_reloc_fixups): Likewise.
2091
2092 Mon Apr  4 15:30:49 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2093
2094         * aoutx.h (NAME(aout,bfd_free_cached_info)): Don't free anything
2095         if we don't have a bfd_object.
2096
2097         Made sure that every call to bfd_read, bfd_write, and bfd_seek
2098         checks the return value and handled bfd_error correctly.  These
2099         changes are not itemised.  Also:
2100         * aoutx.h (emit_strtab): Change return type to boolean, and return
2101         errors.
2102         (NAME(aout,write_syms)): Check emit_strtab return value.
2103         (NAME(aout,final_link)): Likewise.
2104         * coffcode.h (coff_write_relocs): Change return type to boolean,
2105         and return errors.
2106         (coff_write_object_contents): Check coff_write_relocs return
2107         value.
2108         * i386os9k.c (os9k_swap_exec_header_in): Change return type to
2109         boolean.
2110         (os9k_object_p): Check os9k_swap_exec_header_in return value.
2111         * oasys.c (oasys_read_record): Change return type to boolean.
2112         (oasys_slurp_symbol_table: Check oasys_read_record return value.
2113         (oasys_object_p, oasys_slurp_section_data): Likewise.
2114         (oasys_write_record): Change return type to boolean.
2115         (oasys_write_syms): Likewise.  Also, check oasys_write_record
2116         return value.
2117         (oasys_write_sections): Check oasys_write_record return value.
2118         (oasys_write_header): Change return type to boolean.  Check
2119         oasys_write_record return value.
2120         (oasys_write_end, oasys_write_data): Likewise.
2121         (oasys_write_object_contents): Check return values of
2122         oasys_write_header, oasys_write_syms, oasys_write_data, and
2123         oasys_write_end.
2124         * srec.c (srec_write_record): Change return type to boolean.
2125         (srec_write_header): Likewise.  Also, check srec_write_record
2126         return value.
2127         (srec_write_section, srec_write_terminator): Likewise.
2128         (srec_write_symbols): Change return type to boolean.
2129         (internal_srec_write_object_contents): Check return value of
2130         srec_write_symbols, srec_write_header, srec_write_section, and
2131         srec_write_terminator.
2132
2133         * Makefile.in: Rebuilt dependencies.
2134
2135 Mon Apr  4 10:56:45 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
2136
2137         * aix386-core.c (aix386_bfd_is_local_label):  Correct cast from
2138         asection to asymbol.
2139         * ptrace-core.c (ptrace_unix_bfd_is_local_label):  Correct cast from
2140         bfd to asymbol.
2141         * trad-core.c (trad_unix_bfd_is_local_label):  Correct cast from
2142         asection to asymbol.
2143
2144 Sun Apr  3 18:27:29 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2145
2146         * som.c (som_slurp_string_table): Use malloc to allocate space
2147         for the cached copy of the native string table.
2148         (som_slurp_symbol_table): Likewise for the native symbol table.
2149         (som_slurp_reloc_table): Likewise for the native and generic
2150         relocation tables.
2151         (som_bfd_free_cached_info): Free the cached native strings,
2152         symbols, and relocations.  Also free the canonical cached
2153         relocations.
2154
2155 Fri Apr  1 12:40:58 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2156
2157         * aoutx.h (aout_link_write_symbols): If keep_memory is false, make
2158         sure the symbol name is stored in permanent memory before adding
2159         it to the string table.
2160
2161         * archive.c (_bfd_write_archive_contents): Once we've found an
2162         object, don't bother to look for more when deciding whether to
2163         build a map.
2164         (compute_and_write_armap): After adding the symbols for a BFD,
2165         call bfd_free_cached_info on it.
2166
2167         Add bfd_free_cached_info support to a.out backends.
2168         * aoutx.h (aout_get_external_symbols): Renamed from
2169         aout_link_get_symbols.  Read strings even if symbols have been
2170         read.  Store string size in obj_aout_string_size.
2171         (NAME(aout,slurp_symbol_table)): Call aout_get_external_symbols to
2172         read the symbols.  Allocate the cached symbols with malloc, not
2173         bfd_alloc.
2174         (NAME(aout,slurp_reloc_table)): Allocate the cached relocs with
2175         malloc, not bfd_alloc.
2176         (NAME(aout,bfd_free_cached_info)): New function; free cached
2177         symbols and relocs.
2178         * libaout.h (struct aoutdata): Add external_string_size field.
2179         (obj_aout_external_string_size): New accessor macro.
2180         (NAME(aout,close_and_cleanup)): Don't declare.
2181         (NAME(aout,bfd_free_cached_info)): Declare.
2182         (aout_32_close_and_cleanup): Don't define.
2183         (aout_64_close_and_cleanup): Don't define.
2184         * aout-target.h (MY_bfd_free_cached_info): If not already defined,
2185         define as NAME(aout,free_cached_info).
2186         (MY_close_and_cleanup): If not already defined, define as
2187         MY_bfd_free_cached_info.
2188         * aout-adobe.c (aout_32_close_and_cleanup): Define.
2189         (aout_32_bfd_free_cached_info): Don't define.
2190         * bout.c (aout_32_close_and_cleanup): Define.
2191         (aout_32_bfd_free_cached_info): Don't define.
2192         * hp300hpux.c (MY_bfd_free_cached_info): Define as bfd_true.
2193         (MY_close_and_cleanup): Don't define.
2194         * i386lynx.c (NAME(lynx,slurp_reloc_table)): Allocate the cached
2195         relocs with malloc, not bfd_alloc.
2196         * i386os9k.c (aout_32_close_and_cleanup): Define.
2197         (aout_32_bfd_free_cached_info): Don't define.
2198
2199         Add a new entry point to free memory cached by a BFD.
2200         * targets.c (bfd_target): Add _bfd_free_cached_info field.
2201         * bfd.c (bfd_free_cached_info): Define.
2202         * bfd-in.h (JUMP_TABLE): Add _bfd_free_cached_info.
2203         * bfd-in2.h: Rebuilt.
2204         * All backends: Initialize bfd_free_cached_info entry point to
2205         bfd_true.
2206
2207         * elf32-hppa.c (elf_hppa_reloc_type_lookup): Correct type of
2208         first, unused, argument.
2209         (hppa_elf_is_local_label): Declare instead of
2210         som_bfd_is_local_label.
2211
2212         * coff-a29k.c (a29k_reloc): Add reloc_entry->address to value of
2213         absolute R_IREL reloc.
2214
2215 Thu Mar 31 11:52:15 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2216
2217         Added some support for Irix 4 shared libraries.
2218         * ecoff.c (ecoff_new_section_hook): Set SEC_SHARED_LIBRARY for a
2219         .lib section.
2220         (ecoff_sec_to_styp_flags): Set SEC_SHARED_LIBRARY if
2221         STYP_ECOFF_LIB bit is set.
2222         (ecoff_compute_section_file_positions): Round the contents of a
2223         .lib section up to the next page boundary.
2224         (ecoff_set_section_contents): If we see a .lib section, increment
2225         the vma by one to count the number of shared libraries we have.
2226         (ecoff_write_object_contents): Don't crash if we see a
2227         STYP_ECOFF_LIB section, and don't adjust text_start or data_start
2228         or bss_size either.
2229
2230         * coffcode.h (CALC_ADDEND): Change to fetch original symbol value
2231         from original BFD, rather than using value of current BFD symbol.
2232         Needed for new linker.
2233         * coff-sparc.c (CALC_ADDEND): Likewise.
2234
2235         * ecoff.c (ecoff_write_object_contents): Set the text_start and
2236         data_start entries in the optional header correctly even if a text
2237         or data section starts at location zero.
2238
2239         * reloc.c (bfd_reloc_code_real_type): Added BFD_RELOC_26 (from sef
2240         and raeburn).
2241         * bfd-in2.h: Rebuilt.
2242
2243         * nlm32-i386.c (nlm_i386_read_import): Null terminate the symbol
2244         name.
2245         * nlm32-alpha.c (nlm_alpha_read_import): Likewise.
2246         * nlm32-sparc.c (nlm_sparc_read_import): Likewise.
2247
2248         * coffgen.c (coff_write_symbol): Reindented.  Changed to return
2249         boolean, and changed written to unsigned int *.  Check error
2250         returns from called functions.
2251         (coff_write_alien_symbol): Likewise.
2252         (coff_write_native_symbol): Likewise.
2253         (coff_write_symbols): Likewise.  Reworked checks on whether to
2254         write symbol name to string table for clarity and to avoid core
2255         dumping when given a non COFF symbol.
2256         * libcoff-in.h (coff_write_symbols): Declare as returning boolean.
2257         * libcoff.h: Rebuilt.
2258         * coffcode.h (coff_write_object_contents): Check return value of
2259         coff_write_symbols.
2260
2261 Wed Mar 30 16:25:41 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2262
2263         Changes to let BFD return an error indication from
2264         get_symtab_upper_bound, bfd_canonicalize_symtab,
2265         bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc.  They now
2266         return long instead of unsigned int, and use -1 to indicate an
2267         error.  Along the way, rename get_symtab_upper_bound to
2268         bfd_get_symtab_upper_bound.
2269         * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on
2270         errors.
2271         (bfd_canonicalize_reloc): Likewise.
2272         * syms.c (bfd_get_symtab_upper_bound): Renamed from
2273         get_symtab_upper_bound.
2274         * targets.c (bfd_target): Renamed _get_symtab_upper_bound to
2275         _bfd_get_symtab_upper_bound, and changed it and
2276         _bfd_canonicalize_symtab and _get_reloc_upper_bound and
2277         _bfd_canonicalize_reloc to all return long.
2278         * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors.
2279         (NAME(aout,canonicalize_reloc)): Likewise.
2280         (NAME(aout,get_reloc_upper_bound)): Likewise.
2281         (NAME(aout,get_symtab_upper_bound)): Likewise.
2282         * bout.c (b_out_canonicalize_reloc): Likewise.
2283         (b_out_get_reloc_upper_bound): Likewise.
2284         * coffcode.h (coff_canonicalize_reloc): Likewise.
2285         * coffgen.c (coff_get_symtab_upper_bound): Likewise.
2286         (coff_get_symtab): Likewise.
2287         (coff_get_reloc_upper_bound): Likewise.
2288         * ecoff.c (ecoff_get_symtab_upper_bound): Likewise.
2289         (ecoff_get_symtab): Likewise.
2290         (ecoff_canonicalize_reloc): Likewise.
2291         * elfcode.h (elf_get_symtab_upper_bound): Likewise.
2292         (elf_get_reloc_upper_bound): Likewise.
2293         (elf_canonicalize_reloc): Likewise.
2294         (elf_get_symtab): Likewise.
2295         * hp300hpux.c (MY(get_symtab)): Likewise.
2296         (MY(get_symtab_upper_bound)): Likewise.
2297         (MY(canonicalize_reloc)): Likewise.
2298         * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
2299         * ieee.c (ieee_slurp_external_symbols): Change return type to
2300         boolean.  Check for errors from get_symbol.
2301         (ieee_slurp_symbol_table): Change return type to boolean.  Check
2302         for errors from ieee_slurp_external_symbols.
2303         (ieee_get_symtab_upper_bound): Return long, and -1 on errors.
2304         (ieee_get_symtab): Likewise.
2305         (ieee_get_reloc_upper_bound): Likewise.
2306         (ieee_canonicalize_reloc): Likewise.
2307         * mipsbsd.c (MY(canonicalize_reloc)): Likewise.
2308         * nlmcode.h (nlm_get_symtab_upper_bound): Likewise.
2309         (nlm_get_symtab): Likewise.
2310         (nlm_get_reloc_upper_bound): Likewise.
2311         (nlm_canonicalize_reloc): Likewise.
2312         * oasys.c (oasys_get_symtab_upper_bound): Likewise.
2313         (oasys_get_symtab): Likewise.
2314         (oasys_get_reloc_upper_bound): Likewise.
2315         (oasys_canonicalize_reloc): Likewise.
2316         * som.c (som_get_symtab_upper_bound): Likewise.
2317         (som_get_symtab): Likewise.
2318         (som_get_reloc_upper_bound): Likewise.
2319         (som_canonicalize_reloc): Likewise.
2320         * srec.c (srec_get_symtab_upper_bound): Likewise.
2321         (srec_get_symtab): Likewise.
2322         (srec_get_reloc_upper_bound): Define as bfd_0l.
2323         (srec_canonicalize_reloc): Likewise.
2324         * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors.
2325         (tekhex_get_symtab_upper_bound): Likewise.
2326         (tekhex_get_reloc_upper_bound): Define as bfd_0l.
2327         (tekhex_canonicalize_reloc): Likewise.
2328         * libaout.h (NAME(aout,get_symtab_upper_bound)): Change
2329         declaration to return long.
2330         (NAME(aout,get_symtab)): Likewise.
2331         (NAME(aout,canonicalize_reloc)): Likewise.
2332         (NAME(aout,get_reloc_upper_bound)): Likewise.
2333         * libcoff-in.h (coff_get_symtab_upper_bound): Likewise.
2334         (coff_get_symtab): Likewise.
2335         (coff_get_reloc_upper_bound): Likewise.
2336         * libecoff.h (ecoff_get_symtab_upper_bound): Likewise.
2337         (ecoff_get_symtab): Likewise.
2338         (ecoff_canonicalize_reloc): Likewise.
2339         * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise.
2340         (bfd_elf32_get_symtab): Likewise.
2341         (bfd_elf32_get_reloc_upper_bound): Likewise.
2342         (bfd_elf32_canonicalize_reloc): Likewise.
2343         (bfd_elf64_get_symtab_upper_bound): Likewise.
2344         (bfd_elf64_get_symtab): Likewise.
2345         (bfd_elf64_get_reloc_upper_bound): Likewise.
2346         (bfd_elf64_canonicalize_reloc): Likewise.
2347         * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise.
2348         (nlmNAME(get_symtab)): Likewise.
2349         (nlmNAME(get_reloc_upper_bound)): Likewise.
2350         (nlmNAME(canonicalize_reloc)): Likewise.
2351         * archive.c (compute_and_write_armap): Use error_return and
2352         no_memory_return labels rather than freeing information in various
2353         places.  Change storage, symcount and src_count to long.  Check
2354         errors from bfd_get_symtab_upper_bound and
2355         bfd_canonicalize_symtab.
2356         * bout.c (b_out_relax_section): Change reloc_size to long.  Check
2357         for errors from bfd_get_reloc_upper_bound and
2358         bfd_canonicalize_reloc.
2359         (b_out_get_relocated_section_contents): Likewise.
2360         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
2361         Likewise.
2362         * elf32-mips.c: Likewise.
2363         * elf32-hppa.c (hppa_elf_stub_finish): Likewise.
2364         (hppa_look_for_stubs_in_section): Check for errors from
2365         bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
2366         bfd_canonicalize_reloc.
2367         * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors
2368         from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
2369         * linker.c (generic_link_read_symbols): Likewise.
2370         (_bfd_generic_final_link): Check for errors from
2371         bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
2372         * reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
2373         * reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
2374         (bfd_coff_reloc16_get_relocated_section_contents): Likewise.
2375         * libbfd.c (bfd_0l): New function.
2376         * libbfd-in.h (bfd_0l): Declare.
2377         * aix386-core.c: Change get_symtab_upper_bound, get_symtab,
2378         get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather
2379         than bfd_0u.
2380         * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise.
2381         * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise.
2382         * bfd-in2.h: Rebuilt.
2383         * libbfd.h: Rebuilt.
2384         * libcoff.h: Rebuilt.
2385
2386         * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables
2387         temp and name.
2388
2389 Wed Mar 30 08:33:04 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
2390
2391         * hosts/dpx2.h: Define POSIX_UTIME.
2392
2393 Wed Mar 30 00:31:49 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
2394
2395         * i386dynix.c, config/i386-dynix.mt:  New files, handling Dynix
2396         variant of a.out.
2397         * configure.in, config.bfd:  Use them for Dynix.
2398         * Makefile.in:  Add dependencies for i386dynix.o. 
2399         * targets.c:  Add definition for i386dynix_vec.
2400         * hosts/symmetry.h:  Do not define TRAD_CORE_USER_OFFSET for Dynix.
2401         Define HOST_DATA_START_ADDR and TRAD_UNIX_CORE_FILE_FAILING_SIGNAL
2402         for Dynix. Remove inclusion of dynix3.h, Dynix bfd is now handled by
2403         i386dynix.c
2404
2405 Mon Mar 28 12:53:27 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2406
2407         * Makefile.in (BFD32_BACKENDS): Add coff-sparc.o.
2408
2409         * coffcode.h (coff_set_flags): Handle bfd_arch_powerpc like
2410         bfd_arch_rs6000.
2411
2412         * config.bfd (powerpc-*-aix*): New target; use rs6000.mt.
2413         * config/rs6000.mt (SELECT_ARCHITECTURES): Add bfd_powerpc_arch.
2414
2415         * aoutx.h (translate_from_native_sym_flags): Set SEC_RELOC flag
2416         for generated constructor section.
2417
2418 Sun Mar 27 16:25:22 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2419
2420         * som.c (som_begin_writing): New approach at dealing with holes
2421         in executables left by the HP linker.  Does not rely on subspace
2422         alignments as subspaces are *NOT* guaranteed to be properly
2423         aligned in an executable (can you believe that!).
2424
2425 Sat Mar 26 10:25:43 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2426
2427         * som.c (som_get_section_contents): New function.  Do not try
2428         to actually read data from a section that doesn't have either
2429         SEC_LOAD or SEC_DEBUGGING set (eg $BSS$) just return true.
2430
2431         * libbfd.c (bfd_read): Set bfd_error as appropriate for a short
2432         read. (bfd_error_system_call or bfd_error_file_truncated).
2433
2434         * som.c: Do not blindly set bfd_error_system_call after a
2435         failing bfd_read, bfd_write, or bfd_seek.  In a few places
2436         (like som_object_p) override the error status set by bfd_read.
2437
2438         * aix386-core.c, aout-encap,c archive.c, bout.c: Likewise.
2439         * coff-rs6000.c, coffgen.c ecoff.c, elf.c: Likewise.
2440         * elf32-hppa.c, elfcode.h, hp300hpux.c, i386lynx.c: Likewise.
2441         * nlm32-alpha.c, nlm32-i386.c, nlm32-sparc.c: Likewise.
2442
2443         * som.c: Check return values from several bfd_{seek,read,write}
2444         calls that we just assumed were not failing.
2445
2446 Fri Mar 25 11:44:06 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
2447
2448         * hosts/sysv4.h (HAVE_PROCFS): Add comments about ptx4.
2449         * config/sysv4.mh: Add comment.
2450         * config/symmetry.mh: Change comment.
2451         * configure.host: Use sysv4, not symmetry, for i[34]86-sequent-sysv4*.
2452
2453 Fri Mar 25 17:10:45 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2454
2455         Changes to support linker relaxing of embedded MIPS PIC code to
2456         use a five instruction sequence for function calls which are out of
2457         range of the bal instruction.
2458         * libecoff.h (struct ecoff_section_tdata): Define.
2459         (ecoff_section_data): Define.
2460         (ecoff_bfd_relax_section): Don't define.
2461         * ecoff.c (ecoff_final_link_debug_accumulate): Don't read or free
2462         the debugging information if it has already been read.
2463         (ecoff_indirect_link_order): Handle _cooked_size being different
2464         from _raw_size.  Don't reread the contents or the relocs if they
2465         have already been read in.
2466         * coff-mips.c (mips_howto_table): Change bitsize of PCREL16 from
2467         18 to 16.
2468         (PCREL16_EXPANSION_ADJUSTMENT): Define.
2469         (mips_relocate_refhi): Take adjust argument.
2470         (mips_relocate_section): Handle reloc offsets stored in section
2471         used_by_bfd field.  Call mips_relax_pcrel16 to handle details of
2472         expanding an out of range PCREL16.  Keep trace of adjustments
2473         required by expansions.  Set s and unset h when converting a reloc
2474         from undefined to section.  Change handling of PC relative relocs:
2475         if against a section, they are correct in the object file, if
2476         against an external symbol they are pcrel_offset.
2477         (mips_relax_section): New function.
2478         (mips_relax_pcrel16): New function.
2479         (ecoff_bfd_relax_section): Define.
2480         * coff-alpha.c (ecoff_bfd_relax_section): Define.
2481         * ecofflink.c (bfd_ecoff_debug_accumulate): Handle adjustments
2482         built by mips_relax_section when writing out addresses.
2483         * elf32-mips.c (mips_elf_read_ecoff_info): Clear adjust field.
2484
2485         * aoutx.h (NAME(aout,find_nearest_line)): The caller expects
2486         functionname_ptr to be set to a symbol name, so prepend
2487         symbol_leading_char.
2488
2489 Thu Mar 24 11:33:46 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
2490
2491         * coff-h8300.c (h8300_reloc16_extra_cases): Add relaxing info
2492         for 16bit relative branches.
2493         * coff-h8500.c (r_high8, r_low16, r_high16): Don't complain on
2494         overflow.
2495
2496 Thu Mar 24 09:21:13 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2497
2498         * som.c (som_bfd_prep_for_ar_write): Ignore non-SOM objects.
2499         (som_bfd_ar_write_symbol_stuff, som_write_armap): Likewise.
2500
2501 Wed Mar 23 14:29:31 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
2502
2503         * netbsd386.c (N_SET_FLAGS): Delete the old definition.
2504
2505 Wed Mar 23 14:58:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2506
2507         Clean up the relaxing code for the new linker.
2508         * targets.c (_bfd_relax_section): Take boolean *again argument
2509         rather than asymbol list.
2510         * bfd.c (bfd_relax_section): Change name of fourth argument from
2511         symbols to again.
2512         * reloc.c (bfd_generic_relax_section): Take boolean *again
2513         argument rather than asymbol list.  Always return true.
2514         * bout.c: Include genlink.h.
2515         (aligncode, perform_slip): Declare.
2516         (perform_slip): Take BFD argument rather than asymbol list.
2517         Changed all callers.  Get the symbols from the BFD.  Change the
2518         hash table entry value as well as the symbol value.
2519         (abs32code): Take BFD argument rather than asymbol list.  Changed
2520         all callers.
2521         (aligncode): Likewise.
2522         (b_out_relax_section): Take boolean *again argument rather than
2523         asymbol list.  Only return false if an error occurred.  Set *again
2524         to false.  Get symbols from BFD.
2525         * reloc16.c: Include genlink.h.
2526         (bfd_perform_slip): Take BFD argument rather than asymbol list.
2527         Get the symbols from the BFD.  Change the hash table entry value
2528         as well as the symbol value.
2529         (bfd_coff_reloc16_relax_section): Take boolean *again argument
2530         rather than asymbol list.  Only return false if an error occurred.
2531         Set *again to false.  Get symbols from BFD.
2532         * coffcode.h (bfd_coff_backend_data): Change
2533         _bfd_coff_reloc16_estimate to take BFD argument rather than
2534         asymbol list.
2535         (bfd_coff_reloc16_estimate): Corresponding change.
2536         (dummy_reloc16_estimate): Corresponding change.
2537         * libcoff-in.h (bfd_coff_reloc16_relax_section): Change
2538         declaration to take boolean * rather than asymbol list.
2539         (bfd_perform_slip): Change declaration to take BFD rather than
2540         asymbol list.
2541         * coff-h8300.c (h300_reloc16_estimate): Take BFD argument rather
2542         than asymbol list.  Changed calls to bfd_perform_slip.
2543         * bfd-in2.h: Rebuilt.
2544         * libbfd.h: Rebuilt.
2545         * libcoff.h: Rebuilt.
2546         * Makefile.in: Rebuilt dependencies.
2547
2548         * genlink.h (_bfd_generic_link_get_symbols): Define.
2549         (_bfd_generic_link_get_symcount): Define.
2550         * linker.c (generic_link_read_symbols): New function.
2551         (generic_link_add_object_symbols): Use it.  Use
2552         _bfd_generic_link_get_symbols and _bfd_generic_link_get_symcount
2553         to get the symbols from the BFD.
2554         (generic_link_check_archive_element): Likewise.
2555         (_bfd_generic_final_link): Likewise.
2556         (_bfd_generic_link_output_symbols): Likewise.
2557         (default_indirect_link_order): Likewise.
2558         (generic_link_add_symbol_list): Store pointer to hash table entry
2559         in asymbol udata field.
2560
2561 Tue Mar 22 13:09:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2562
2563         * coff-mips.c (mips_howto_table): Add entry for new MIPS_R_PCREL16
2564         reloc, used in embedded PIC code.
2565         (mips_adjust_reloc_in): Change sanity check to permit new reloc.
2566         (mips_bfd_reloc_type_lookup): Turn BFD_RELOC_16_PCREL_S2 into
2567         MIPS_R_PCREL16.
2568
2569         * elf32-mips.c (mips_elf_final_link): Account for link_order
2570         relocs when allocating space for relocations.  Set SEC_RELOC flag
2571         for any section which has relocs.  Handle link_order relocs in
2572         link_order loop.  Use _bfd_generic_link_add_symbols_collect for
2573         add_symbls entry point.
2574
2575         * linker.c (_bfd_generic_final_link): Set reloc_count to 0 before
2576         counting relocs.  Set SEC_RELOC flag for any section which has
2577         relocs.
2578
2579         * linker.c (_bfd_default_link_order): Handle bfd_data_link_order.
2580
2581         * linker.c (_bfd_generic_link_add_symbols): Just call
2582         generic_link_add_symbols.
2583         (_bfd_generic_link_add_symbols_collect): New function, like
2584         _bfd_generic_link_add_symbols but also collect constructors and
2585         destructors by name as collect2 does.
2586         (generic_link_add_symbols): New function, like old
2587         _bfd_generic_link_add_symbols but with collect argument.
2588         (generic_link_add_object_symbols): Take collect argument.
2589         (generic_link_check_archive_element_no_collect): New function.
2590         (generic_link_check_archive_element_collect): New function.
2591         (generic_link_check_archive_element): Take collect argument.
2592         (generic_link_add_symbol_list): Take collect argument.
2593         (_bfd_generic_link_add_one_symbol): Rename constructor argument to
2594         collect.
2595         * libbfd-in.h (_bfd_generic_link_add_symbols_collect): Declare.
2596         * libbfd.h: Rebuilt.
2597
2598 Tue Mar 22 10:04:00 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2599
2600         * archive.c (bfd_construct_extended_name_table): Use ar_padchar
2601         for first character in an extended name.
2602         (_bfd_write_archive_contents): If ar_padchar == '/', then use
2603         "//" as the name of the special archive member holding the
2604         extended name table.
2605
2606 Mon Mar 21 12:28:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2607
2608         Support for link_order types which generate relocs in order to
2609         support -Ur in the linker.
2610         * linker.c (generic_link_add_symbol_list): Remove bitsize argument
2611         from call to _bfd_generic_link_add_one_symbol.
2612         (_bfd_generic_link_add_one_symbol): Remove bitsize argument.
2613         Don't pass bitsize to constructor call back.  Pass BFD_RELOC_CTOR
2614         instead of bitsize to add_to_set call back.
2615         (_bfd_generic_final_link): Account for link_order relocs when
2616         allocating space for relocations.  Handle them in link_order loop.
2617         (_bfd_generic_reloc_link_order): New function.
2618         (_bfd_default_link_order): If a reloc_link_order is seen here,
2619         abort.
2620         (_bfd_count_link_order_relocs): New function.
2621         * libbfd-in.h (_bfd_generic_link_add_one_symbol): Remove bitsize
2622         argument from declaration.
2623         (_bfd_generic_reloc_link_order): Declare.
2624         (_bfd_count_link_order_relocs): Declare.
2625         * libbfd.h: Rebuilt.
2626         * aoutx.h (aout_link_add_symbols): Remove bitsize argument from
2627         call to _bfd_generic_link_add_one_symbol.
2628         (NAME(aout,final_link)): Account for link_order relocs when
2629         allocating space for relocations.  Handle them after handling all
2630         input BFDs.
2631         (aout_link_reloc_link_order): New function.
2632         * ecoff.c (ecoff_link_add_externals): Remove bitsize argument from
2633         call to _bfd_generic_link_add_one_symbol.
2634         (ecoff_bfd_final_link): Account for link_order relocs when
2635         allocating space for relocations.  Handle them in link_order loop.
2636         (ecoff_link_write_external): Set the storage class of a defined
2637         linker created symbol based on the section it is in.  Correct
2638         bfd_link_hash_weak case to use .sc rather than .st.
2639         (ecoff_reloc_link_order): New function.
2640         * coff-alpha.c (alpha_bfd_reloc_type_lookup): Handle
2641         BFD_RELOC_CTOR.
2642         * coff-mips.c (mips_bfd_reloc_type_lookup): Likewise.
2643
2644         * sunos.c (sunos_read_dynamic_info): Remove unused locals dynsym
2645         and buf.
2646
2647         * cisco-core.c (cisco_core_file_p): Only pass one argument to
2648         bfd_zmalloc.  Free a pointer, not a union.
2649         (cisco_bfd_is_local_label): Correct cast from asection to asymbol.
2650
2651 Sun Mar 20 09:24:36 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2652
2653         * bfd/som.c (som_begin_writing): Fix thinko (off by one error).
2654
2655         * som.c (bfd_section_from_som_symbol): Only to do the value
2656         comparison for function symbols within executables.
2657
2658         * som.c (bfd_section_from_som_symbol): Renamed from
2659         som_section_from_subspace_index.  Pass in a native SOM symbol.
2660         For executables, iterate through the sections to find out
2661         which contains the symbol's address rather than using the
2662         symbol_info field.  (symbol_info has a different meaning for
2663         dynamicly linked executables.)
2664
2665         * trad-core.c (trad_unix_core_file_p): Don't pass abfd to
2666         bfd_zmalloc.
2667
2668         * som.c (som_begin_writing): Fix braino (one call to align
2669         space/subspace data was done unconditionally rather than
2670         just for executables.)
2671
2672         * som.c (som_begin_writing): Align text in all executables to
2673         make HPUX kernel happy.  Fixes strip/objcopy for shared
2674         executables.
2675
2676 Sat Mar 19 07:06:59 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2677
2678         * som.c (som_begin_writing): Account for alignment needs of
2679         subspaces too when writing executables.  Never request a negative
2680         bss size.  Fixes some problems with demand paged executables,
2681         still having problems with pure executables and shared executables.
2682
2683 Fri Mar 18 19:12:47 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
2684
2685         * trad-core.c (trad_unix_core_file_p): Call bfd_zmalloc not
2686         bfd_zalloc for rawptr, because later on we may call free, not
2687         bfd_release, on it.
2688
2689         * bfd.c (struct _bfd): Add cisco_core_struct to tdata union.
2690         * libbfd.c (bfd_read, bfd_seek): Add comments regarding errors.
2691         * cisco-core.c: New file.
2692         * Makefile.in: Change accordingly.
2693         * configure.in: Recognize cisco_core_vec.
2694         * config/m68k-aout.mt (SELECT_VECS): Add cisco_core_vec.
2695         * targets.c: Add cisco_core_vec.
2696         * bfd-in2.h: Rebuilt.
2697
2698 Fri Mar 18 18:13:49 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2699
2700         * som.h (som_copyable_section_data_struct): New structure
2701         containing all the private section information which needs
2702         to be copied from input section to output section during
2703         objcopy or strip.
2704         (som_section_data_struct): Remove several fields now in
2705         som_copyable_section_data_struct.  Make the space and 
2706         subspace dictionaries be pointers (to save space when
2707         only reading objects).
2708
2709         * som.c (bfd_som_set_section_attributes): Now returns a boolean;
2710         some references changed.  Allocate a copyable data stucture if
2711         none exists.  Store info into the copyable data structure.
2712         (bfd_som_set_subsection_attributes): Likewise.
2713         (som_is_space, som_is_subspace, som_is_container): New functions.
2714         Use these instead of directly accessing private data.
2715         (som_prep_headers): Allocate space and subspace headers here.
2716         Fill in some fields in the space/subspace headers from the
2717         copyable data.
2718         (som_bfd_copy_private_section_data): Only copy the stuff
2719         that we really need to make objcopy and strip work.  Allocate
2720         the copy_data structure for the output bfd before copying.
2721
2722         * som.h (struct som_exec_data): New structure to hold exec
2723         info that must be preserved when running objcopy/strip.
2724         (struct somdata): Add new "exec_data" field and accessor
2725         macro.  Add some comments on how the various fields are used.
2726         (som_section_data_struct): Make is_space and is_subspace bitfields.
2727         Delete unused subspace_index.  All references now use the
2728         target_index field within the section structure itself.
2729
2730         * som.c (make_unique_section): Delete unused declaration.
2731         (som_bfd_copy_private_bfd_data): New function.
2732         (som_object_setup): Allocate space for and save exec information
2733         that needs to be copied during objcopy/strip.
2734         (som_mkobject): Do not allocate space for a file header here.
2735         It is not used when only reading SOM objects.
2736         (som_prep_headers): Allocate space for and attach a file header
2737         to the output bfd.  For executables, use the saved system_id
2738         value rather than trying to guess the right value.  Do not abort
2739         wwhen setting file_hdr->entry* for executables.
2740         (som_begin_writing): For executables, set the exec_entry and
2741         exec_flags fields.
2742         (som_copy_private_backend_section_data): Always return a value.
2743
2744         * libhppa.h (PA_PAGESIZE): Define.
2745
2746         * som.c (SOM_ALIGN): Define.
2747         (som_begin_writing): If writing an executable, initialize all
2748         fields in the exec header to zero.  Update fields in the exec
2749         header as sizes of loadable subspaces are computed.  Carefully
2750         preserve alignments when building executables.  Actually write the
2751         exec after all the fields are filled in.
2752
2753         * Better long-filename handling.  Reads SOM ABI compliant extended
2754         names, but doesn't quite write compliant extended names yet.
2755         * som.c (som_slurp_extended_name_table): Delete function.  The
2756         generic code will handle things correctly.
2757         (som_slurp_armap): Seek to the beginning of the next member.
2758         (normalize): New function.
2759         (som_bfd_ar_write_symbol_stuff): Take the size of the extended
2760         name table into account when computing the file offsets in the
2761         SOM dictionary.  Make sure to align to an even boundary.
2762         (som_write_armap): Initialize the checksum to zero.
2763         (ar_maxchars): Fix.  Opps.
2764
2765 Fri Mar 18 20:35:24 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
2766
2767         * aoutx.h (reloc_type_lookup): Handle BFD_RELOC_CTOR on a 64-bit
2768         machine.  Handle BFD_RELOC_SPARC13 and BFD_RELOC_SPARC_BASE13.
2769
2770 Thu Mar 17 18:26:46 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
2771
2772         * bfd-in.h (BFD_VERSION): Use @VERSION@.
2773         * Makefile.in (bfd.h): Replace it with contents of VERSION file.
2774         * bfd-in2.h: Regenerated.
2775
2776         * trad-core.c (trad_unix_bfd_is_local_label): Fixed typo where
2777         this was also named trad_unix_bfd_copy_private_bfd_data.
2778
2779 Thu Mar 17 10:37:07 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
2780
2781         * aoutx.h, elfcode.h, coff-alpha.c, bout.c, ecoff.c, ecofflink.c,
2782         elf32-hppa.c, elf32-mips.c, linker.c, som.c, sunos.c: If malloc(0)
2783         returns NULL, it is not an error.  It's possible that some of
2784         these checks are not necessary (because the size can never be
2785         zero), but putting in the checks is the conservative thing to do
2786         in light of the fact that some of these malloc calls replaced
2787         unchecked alloca calls, in which a zero argument would work fine.
2788
2789 Thu Mar 17 11:44:45 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2790
2791         * osf-core.c (osf_core_bfd_copy_private_bfd_data): Remove
2792         duplicate definition.
2793         (osf_core_bfd_is_local_label): Define.
2794
2795         * reloc.c (bfd_generic_get_relocated_section_contents): Don't fail
2796         if malloc (0) fails.  bfd_canonicalize_reloc returning 0 is not a
2797         failure indication, it merely means there are no relocs.
2798
2799         * elfcode.h (NAME(bfd_elf,write_object_contents)): Don't use space
2800         after NAME, since SunOS /bin/cc can't handle it.
2801
2802 Wed Mar 16 16:43:33 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
2803
2804         * netbsd386.c (N_SET_FLAGS): Don't nuke the machine id field.
2805         From sukes@glue.umd.edu (Tasuki Hirata).
2806
2807 Wed Mar 16 07:55:54 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
2808
2809         * aoutf1.h (4 places): Use a simple #if on ARCH_SIZE, rather than
2810         all that convoluted stuff with NAME, CAT3, etc.  The convoluted
2811         stuff broke for SunOS4 /bin/cc (due to DEFUN elimination, I guess).
2812
2813 Wed Mar 16 00:02:05 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2814
2815         * som.c (som_prep_for_fixups): Detect section symbols based
2816         on either the lack of private data or the symbol flags.  Do not
2817         munge section symbol names anymore -- they no longer confuse GDB.
2818         (som_begin_writing): Leave space for an exec header if writing
2819         an executable.
2820         (som_slurp_symbol_table): Recognize both forms of section symbol
2821         names "L$0\002" and "$<FOO>$".  Change the name of "L$0\002"
2822         section symbols to be the name of the section they represent.
2823         Debugging  symbols begin with "L$0\001", not just "L$".
2824
2825 Tue Mar 15 22:58:28 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2826
2827         * bfd-in2.h, libbfd.h, libcoff.h: Rebuilt.
2828
2829         * bfd-in.h (JUMP_TABLE): Add new entries to the jump table
2830         for bfd_copy_private_section_data, bfd_copy_private_bfd_data,
2831         and bfd_is_local_label.
2832
2833         * targets.c: Add new entries to the bfd_target structure.
2834         
2835         * bfd.c (bfd_copy_private_bfd_data): New definition.
2836
2837         * section.c (bfd_copy_private_section_data): New definition.
2838
2839         * syms.c (bfd_is_local_label): New definition.
2840
2841         * libbfd-in.h (bfd_generic_is_local_label): Declare.
2842
2843         * libbfd.c (bfd_generic_is_local_label): New function.
2844
2845         * *-core.c: Provide default definitions for new functions in
2846         the target vector which all point to bfd_false.
2847
2848         * aout-target.h, coffcode.h, elf32-target.h elf64-target.h, ieee.c
2849         libaout.h, libecoff.h, nlm-target.h, oasys.c, srec.c, tekhex.c
2850         Default new vectors for copying private backend data to bfd_true.
2851         Default new vector for determining if a symbol is a local label
2852         to bfd_generic_is_local_label.
2853
2854         * som.c (som_bfd_copy_private_section_data): New function.
2855         (som_bfd_is_local_label): New function.
2856         (som_bfd_copy_private_bfd_data): For now default to bfd_true.
2857
2858         * elf32-hppa.c (hppa_elf_is_local_label): New function.
2859
2860 Tue Mar 15 23:55:47 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2861
2862         * cf-m68klynx.c (CALC_ADDEND): Use _bfd_m68klynx_howto_table.
2863
2864 Tue Mar 15 04:41:13 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
2865
2866         * Most files:
2867         Replace DEFUN and DEFUN_VOID with K&R-style function definition.
2868         Indent some of them to GNU standards.
2869
2870         * aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
2871         cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
2872         elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
2873         libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
2874         Update copyright years.
2875
2876 Mon Mar 14 11:41:23 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2877
2878         * som.c (som_prep_for_fixups): A relocation involving the section
2879         symbol for the *ABS* section is really a relocation involving
2880         no symbol.
2881         (som_slurp_symbol_table): Do not set BSF_GLOBAL or BSF_EXPORT for
2882         undefined symbols.  Correctly distinguish between debugger symbols
2883         and section symbols.
2884
2885         * som (setup_sections): Set SEC_DEBUGGING and the section attributes
2886         for spaces and subspaces.
2887
2888         * som.c (som_bfd_count_ar_symbols): Fix typo.
2889
2890         * som.c (som_object_setup): Set EXEC_P, D_PAGED, WP_TEXT, and
2891         HAS_RELOC based on the object's magic number.
2892         (make_unique_section): Delete function.  BFD and its users are
2893         prepared to handle multiple sections with the same name.
2894         (setup_sections): Allocate space on the BFD's obstack to hold
2895         section names.  Use bfd_make_setion_anyway rather than the
2896         obsolete make_unique_section.
2897         (som_prep_headers): Choose the correct SOM magic number based
2898         on the BFD's flags.
2899         (som_bfd_fill_in_ar_symbols): Return false, not NULL on error.
2900
2901 Sat Mar 12 09:46:09 1994  Ian Lance Taylor  (ian@cygnus.com)
2902
2903         * elf32-ppc.c: Renamed from elf32-powerpc.c.
2904         * nlm32-ppc.c: Renamed from nlm32-powerpc.c.
2905         * Makefile.in, configure.in: Corresponding changes.
2906
2907 Fri Mar 11 22:27:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
2908
2909         * elf32-powerpc.c: Extensive changes to update to preliminary ABI.
2910
2911 Fri Mar 11 00:34:59 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
2912
2913         * sunos.c (sunos_read_dynamic_info):  Assume that dynamic info
2914         is always located at the start of the data section to allow
2915         recovery of the dynamic info from a stripped executable.
2916         * ecoff.c (ecoff_styp_to_sec_flags):  Handle STYP_PDATA, STYP_XDATA
2917         and STYP_COMMENT.
2918
2919 Wed Mar  9 17:17:53 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
2920
2921         * libbfd-in.h: Remove alloca cruft.  It was missing some necessary
2922         cruft (like the #pragma alloca for AIX).
2923         In addition to that problem, the C alloca calls xmalloc, which
2924         means checking for being out of memory can't work right.  The
2925         following changes remove all uses of alloca from BFD.
2926         * hosts/solaris2.h: Remove alloca cruft.
2927         * som.c: Replace alloca with a fixed size auto array.
2928         * aoutx.h, elfcode.h, nlmcode.h, bout.c, coff-alpha.c, ecoff.c,
2929         ecofflink.c, elf32-hppa.c, elf32-mips.c, linker.c, reloc.c, som.c,
2930         sunos.c: Replace alloca with malloc and appropriate error checking and
2931         freeing.
2932         * linker.c: Replace alloca with obstack_alloc.
2933         * libbfd.h: Rebuilt.
2934
2935 Tue Mar  8 12:10:38 1994  Ian Lance Taylor  (ian@cygnus.com)
2936
2937         * coff-mips.c (mips_relocate_section): Handle MIPS_R_LITERAL like
2938         MIPS_R_GPREL.
2939
2940 Sat Mar  5 14:08:54 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
2941
2942         * elf32-hppa.h, elfcode.h:  Replace uses of Elf*_Half, Elf*_Word,
2943         Elf*_Off typedefs by their expansion, the typedefs have been
2944         removed from include/elf/internal.h.
2945         * elfcode.h (bfd_section_from_shdr):  Handle SHT_DYNAMIC section like
2946         SHT_PROGBITS section.
2947
2948 Thu Mar  3 20:03:39 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2949
2950         * som.h (_PA_RISC_ID): Treat HOST_HPPAOSF just like HOST_HPPABSD.
2951
2952 Wed Mar  2 13:28:06 1994  Jim Kingdon  (kingdon@deneb.cygnus.com)
2953
2954         * configure.host: Recognize i[34]86-sequent-*.
2955
2956         * trad-core.c (trad_unix_core_file_p): A non-zero, not zero,
2957         return from bfd_seek indicates an error.
2958         New macro TRAD_CORE_DSIZE_INCLUDES_TSIZE to replace
2959         TRAD_CORE_STACK_OFFSET.
2960         * hosts/symmetry.h: Define TRAD_CORE_DSIZE_INCLUDES_TSIZE and
2961         TRAD_CORE_USER_OFFSET but not HOST_STACK_OFFSET.
2962
2963 Wed Mar  2 11:57:03 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
2964
2965         * som.[ch]: Do not include libhppa.h in som.c, instead include
2966         it in som.h.
2967
2968         * elf32-hppa.[ch]: Do not include libhppa.h in elf32-hppa.c, instead
2969         include it in elf32-hppa.h.
2970
2971         * som.c (log2): Return -1 on error rather than aborting.
2972         (setup_sections): Bubble up an error from log2.
2973
2974         * Changes to make HP C compiler happy in both traditional
2975         and ANSI mode.
2976         * som.c (hppa_som_gen_reloc_type): Use correct enum type for
2977         field parameter.
2978         (bfd_som_set_section_attributes): Use unsigned int rather than
2979         unsigned char to avoid GNU-C extensions.
2980         (bfd_som_attach_aux_hdr): Return a boolean to indicate success
2981         or failure rather than aborting on failure.
2982
2983         * som.h (bfd_som_set_section_attributes): Fix prototype to match
2984         som.c changes.
2985         (bfd_som_attach_aux_hdr): Add prototype.
2986         (hppa_som-gen_reloc_type): Likewise.
2987
2988         * elf32-hppa.c: Add a couple casts to make HP compiler happy.
2989         (hppa_look_for_stubs_in_section): Do not return false on failure
2990         until rest of code is ready to handle it.  Abort for now.
2991
2992 Tue Mar  1 18:33:59 1994  Jim Kingdon  (kingdon@deneb.cygnus.com)
2993
2994         * bfd-in2.h: Rebuilt.
2995
2996 Tue Mar  1 13:06:53 1994  Kung Hsu  (kung@mexican.cygnus.com)
2997
2998         * i386os9k.c: use new functions bfd_set_error and bfd_get_error.
2999         * Makefile.in: delete an extra blank.
3000         * configure.in : Add i396os9k_vec.
3001
3002 Mon Feb 28 15:41:01 1994  Kung Hsu  (kung@mexican.cygnus.com)
3003
3004         * config.bfd : Add i386-os9k.
3005         * config/i386-os9k.mt : Newly add os9k target makefile.
3006
3007         * i386os9k.c : new file to handle os9k format bfd.
3008         * Makefile.in : Handle new file i386os9k.c
3009         * targets.c : Add bfd_target_os9k_flavour and i386os9k_vec.
3010         * cache.c : Initialize cache_sentinel to 0.
3011
3012 Sun Feb 27 16:30:55 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3013
3014         * elf32-hppa.c (mismatches, retval_mismatches): Fix mismatch
3015         action in case where caller specified no argument relocation.
3016         (hppa_elf_build_linker_stub): Try again to get the sym_ptr_ptr
3017         right in the original relocation and the stub's relocation.
3018
3019         * elf32-hppa.h (hppa_look_for_stub_in_section): Fix typo.  Delete
3020         unused symbols argument.
3021
3022         * elf32-hppa.c (hppa_elf_stub_reloc): Accept asymbol ** rather
3023         than asymbol * for original target symbol.  All callers changed.
3024         Set reloc->sym_ptr_ptr appropriately.
3025         (hppa_elf_build_linker_stub): Set reloc->sym_ptr_ptr correctly.
3026         (hppa_elf_look_for_stubs_in_section): No longer need symbols
3027         argument.  Use the output symbols when canonicalizing the relocs,
3028         creating them if necessary.
3029
3030         * linker.c (_bfd_generic_link_output_symbols): Do not
3031         rebuild/clobber the output symbols if they already exist.
3032
3033 Sun Feb 27 15:22:36 1994  Stan Shebs  (shebs@andros.cygnus.com)
3034
3035         * targets.c (BFD_SEND, BFD_SEND_FMT): Add debugging versions that
3036         check all the pointer dereferences.  Enabled via DEBUG_BFD_SEND.
3037         * bfd-in2.h: Rebuilt.
3038
3039         * srec.c (hex_value): Always set to a size of 256 bytes.
3040         (srec_init): Cosmetic changes.
3041
3042 Sun Feb 27 11:18:47 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3043
3044         * elf32-hppa.c: Second half of major cleanup.  More comments,
3045         PARAMize and staticize rest of functions.  Delete unused
3046         functions.  Delete unused/unnecessary arguments to some functions.
3047         Group static vars together.  Abort for bad errors until we have
3048         error code propogation working.  Work on spacing and indention.
3049         Add FIXMEs for unresolved problems.  Use enums rather than
3050         #defines for lots of things.  Merge two functions which build
3051         linker stubs into a single function (so they can easily share a
3052         ton of common code).
3053
3054 Sat Feb 26 10:00:45 1994  Ian Lance Taylor  (ian@cygnus.com)
3055
3056         * reloc.c (_bfd_relocate_contents): Adjust handling of overflow to
3057         avoid depending upon right shifts of signed numbers, and to
3058         correct handling of src_mask with lower bits zero.
3059
3060         * aoutx.h, archive.c: Add casts to avoid warnings from SVR4 cc.
3061         * ecoff.c, ecofflink.c, ecoffswap.h, srec.c: Likewise.
3062         * elf32-i386.c: Likewise.
3063         * elfcode.h (bfd_section_from_shdr): Make i unsigned; remove old
3064         #if 0 code.
3065         (elf_write_phdrs): Make i unsigned.
3066         (map_program_segments): Make i and n_left unsigned.
3067         (assign_file_positions_except_relocs): Make i unsigned.
3068         (write_shdrs_and_ehdr): Make count unsigned.
3069         (assign_file_positions_for_relocs): Make i unsigned.
3070         (NAME(bfd,elf_write_object_contents)): Make count unsigned.
3071         (section_from_elf_index): Make index argument unsigned.
3072
3073 Fri Feb 25 21:34:58 1994  Ian Lance Taylor  (ian@cygnus.com)
3074
3075         * elfcode.h: Don't include assert.h.
3076         (swap_out_syms): Use BFD_ASSERT rather than assert.
3077
3078         * linker.c (_bfd_generic_link_write_global_symbol): Add missing
3079         break in switch.
3080
3081         * hosts/i386v4.h (qsort, strtol): Remove incorrect and useless
3082         declarations.
3083
3084 Fri Feb 25 16:35:57 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3085
3086         * libhppa.h (hppa_rebuild_insn): Moved here from elf32-hppa.c.
3087
3088         * elf32-hppa.h (elf_hppa_tc_symbol): Add new arguments.
3089         (elf_hppa_tc_make_sections): Likewise.
3090         (elf_hppa_final_processing): Add extern decl.
3091
3092         * elf32-hppa.c: First half of major cleanup.  Add/cleanup lots of
3093         comments.  PARAMize some static functions.  Delete unused functions.
3094         Delete unused/unnecessary arguments to many functions.  Group
3095         static vars together.  Collapse common case statements together
3096         in many places.  Use default case when possible instead of listing
3097         each case separately.  Abort for bad errors until we get error
3098         code propogation working.  Work on spacing and indention problems.
3099         Add FIXMEs for some unresolved problems.  Delete hopelessly broken 
3100         COMPLEX relocation support (it's never used anyway).
3101         (hppa_elf_rebuild_insn): Delete.  Moved into libhppa.h.
3102         (elf_hppa_tc_symbol): Accept and use new arguments (symext chains).
3103         (elf_hppa_tc_make_sections): Likewise.
3104
3105         * format.c (bfd_check_format_matches): Initialize matching_vector
3106         to keep gcc -Wall quiet.
3107
3108         * elfcode.h (elf_slurp_reloca_table): Fix typo.
3109
3110         * som.c (som_get_symtab_upper_bound): Use "sizeof (asymbol *)"
3111         not "sizeof (som_symbol_type *)".
3112
3113         * elfcode.h (elf_get_symtab_upper_bound): Use "sizeof (asymbol *)"
3114         not "sizeof (asymbol").  Opps.
3115
3116 Fri Feb 25 13:19:04 1994  Ted Lemon  (mellon@pepper.ncd.com)
3117
3118         * bfd.c (bfd_get_gp_size): Can't return gp value on an archive.
3119         (bfd_set_gp_size):  Can't set gp value on an archive.
3120
3121 Fri Feb 25 12:57:00 1994  Steve Chamberlain  (sac@jonny.cygnus.com)
3122
3123         * srec.c (pass_over): Don't skip too many characters when
3124         end of line seen.
3125
3126 Fri Feb 25 11:41:57 1994  Ian Lance Taylor  (ian@cygnus.com)
3127
3128         * ecoff.c (ecoff_sizeof_headers): Align result to 16 byte
3129         boundary.
3130
3131 Thu Feb 24 07:13:22 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3132
3133         * som.c (som_bfd_derive_misc_symbol_info): Derive symbol_info
3134         field for absolute symbols in the same manner as undefined
3135         and common symbols.
3136
3137 Thu Feb 24 04:29:19 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3138
3139         * elfcode.h (elf_core_file_p):  Check for core file e_machine match
3140         like in elf_object_p.
3141
3142 Wed Feb 23 18:28:37 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3143
3144         * elfcode.h (alloca): Delete declaration.
3145
3146         * som.c (som_prep_headers): Use CPU_PA_RISC1_0 for magic
3147         number rather than HP9000S800_ID.  Note som.c is careful
3148         to make sure CPU_PA_RISC1_0 is always defined.
3149
3150 Mon Feb 21 10:12:02 1994  Stan Shebs  (shebs@andros.cygnus.com)
3151
3152         * Makefile.in (targets.o, archures.o): Use ALL_CFLAGS to supply
3153         flags to explicit compile actions.
3154
3155 Mon Feb 21 09:50:06 1994  Ian Lance Taylor  (ian@lisa.cygnus.com)
3156
3157         * ecofflink.c (ecoff_write_symhdr): Set symhdr->magic here.
3158         * ecoff.c (ecoff_write_object_contents): Make sure .bss section
3159         ends on a page boundary if there is no symbol table.
3160         (ecoff_bfd_final_link): Don't set symhdr->magic here.
3161
3162         * hosts/hp300.h: Include <stdlib.h>; don't declare free.
3163
3164         * som.c (som_bfd_count_ar_symbols): Use a pointer and alloca
3165         rather than an array of variable size.
3166         (som_bfd_fill_in_ar_symbols): Likewise.
3167         (som_bfd_ar_write_symbol_stuff): Likewise.
3168
3169         * coff-alpha.c (alpha_relocate_section): Rewrite mask and shift
3170         operation to avoid OSF 1.3 cc bug.
3171         * ecoff.c (ecoff_write_object_contents): Make text_size, data_size
3172         and bss_size bfd_size_type instead of unsigned long.  Make
3173         text_start and data_start bfd_vma instead of unsigned long.
3174         * ecofflink.c (ecoff_add_string): Remove incorrect cast of return
3175         value.
3176
3177 Sun Feb 20 16:06:54 1994  Ian Lance Taylor  (ian@lisa.cygnus.com)
3178
3179         * linker.c (_bfd_generic_link_add_archive_symbols): Consider
3180         symbols in the order they appear in the archive map.
3181
3182 Sat Feb 19 03:17:32 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3183
3184         * coff-alpha.c (reloc_nil):  Add forward declaration, add missing
3185         error_message argument.
3186         * coff-sparc.c (bfd_coff_generic_reloc):  Add forward declaration,
3187         add missing error_message argument.
3188         * mipsbsd.c (mips_fix_hi16_s):  Add forward declaration, add missing
3189         error_message argument.
3190
3191 Fri Feb 18 11:41:58 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3192
3193         Support for PowerPC NetWare.
3194         * nlm32-powerpc.c: New file.
3195         * config.bfd (powerpc-*-netware*): New target; use ppc-nlm.
3196         * config/ppc-nlm.mt: New file.
3197         * configure.in (nlm32_powerpc_vec): New target vector; use
3198         nlm32-powerpc.o, nlm32.o, nlm.o.
3199         * targets.c (nlm32_powerpc_vec): Declare.
3200         * Makefile.in (BFD32_BACKENDS): Add nlm32-powerpc.o.
3201         (CFILES): Add nlm32-powerpc.c.
3202
3203         Initial support for PowerPC ELF.  Done without an ABI, and
3204         probably to be changed when I get an ABI.
3205         * config.bfd (powerpc-*-sysv4*): New target; use ppc-elf.
3206         * config/ppc-elf.mt: New file.
3207         * configure.in (bfd_elf32_powerpc_vec): New target vector; use
3208         elf32-powerpc.o, elf32.o, elf.o.
3209         * elf32-powerpc.c: New file.
3210         * elfcode.h (prep_headers): Add bfd_arch_powerpc case.
3211         (elf_set_arch_mach): Likewise.
3212         * targets.c (bfd_elf32_powerpc_vec): Declare.
3213         * Makefile.in (BFD32_BACKENDS): Add elf32-powerpc.o.
3214         (CFILES): Add elf32-powerpc.c.
3215         Rebuilt dependencies.
3216
3217 Thu Feb 17 15:29:55 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3218
3219         * coffgen.c (coff_write_linenumbers): Always return a value.
3220
3221         * elfcode.h (elf_slurp_symbol_table): Handle zero symbols
3222         reasonably.  Allocate x_symp using alloca.
3223
3224         * elfcode.h (map_program_segments): ELF program header entries
3225         must be sorted by load address.  This used to generate the entries
3226         in reverse order.
3227
3228         * section.c (SEC_IN_MEMORY): Define.
3229         (asection): Rename unused field otheruserdata to contents, and
3230         make it char *.
3231         (bfd_make_section_anyway): Initialize contents field to NULL.
3232         (bfd_get_section_contents): If SEC_IN_MEMORY is set, get section
3233         contents from contents field rather than from file.
3234         * bfd-in2.h: Rebuilt.
3235
3236 Thu Feb 17 08:30:53 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3237
3238         * bfd.c (bfd_get_error, bfd_set_error): New functions.
3239         (bfd_error): Make static.
3240         (bfd_error_type): Renamed from bfd_ec.  Prepend "bfd_error_" to
3241         all values.
3242         * bfd-in2.h: Regenerated.
3243         * aix386-core.c, aout-adobe.c, aout-encap.c, aout-target.h, 
3244         aoutf1.h, aoutx.h, archive.c, archures.c, 
3245         bfd.c, bout.c, cache.c, coff-alpha.c, coff-mips.c, 
3246         coff-rs6000.c, coffcode.h, coffgen.c, core.c, ctor.c, 
3247         ecoff.c, ecofflink.c, elf.c, elf32-hppa.c, elf32-mips.c, 
3248         elfcode.h, format.c, hash.c, hp300hpux.c, hppabsd-core.c, 
3249         i386lynx.c, ieee.c, libbfd.c, libelf.h, linker.c, 
3250         lynx-core.c, nlm.c, nlm32-alpha.c, nlm32-i386.c, 
3251         nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c, 
3252         ptrace-core.c, reloc16.c, rs6000-core.c, section.c, som.c, 
3253         srec.c, sunos.c, syms.c, targets.c, tekhex.c, 
3254         trad-core.c: Change callers.
3255
3256 Tue Feb 15 22:27:27 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3257
3258         * som.c: Remove FIXMEs for things which have been dealt with.
3259
3260 Tue Feb 15 19:39:24 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
3261
3262         * section.c (bfd_get_section_contents): Since this function reads
3263         unrelocated contents, the section's raw size is always the one to
3264         use for bounds checking.
3265
3266         * linker.c (default_indirect_link_order): In assertion, compare
3267         link_order size field against cooked size, not raw size, of input
3268         section.
3269
3270         * bout.c (b_out_get_reloc_upper_bound): For BSS section, just
3271         return 0.
3272         (aligncode): When shrinking, the addend should be set to the
3273         current offset in the section plus the number of bytes of padding
3274         that will actually be retained.
3275         (b_out_relax_section): If a section contains no relocations, don't
3276         bother processing them.
3277         (b_out_get_relocated_section_contents): Set reloc_done.  Assert
3278         that bfd_get_section_contents returns true.  Check that relocs are
3279         properly ordered.
3280         (b_out_get_relocated_section_contents, case ALIGNDONE): Assert
3281         that reloc->addend falls between the current source offset and the
3282         raw size of the input section.
3283
3284         * config.bfd: Support i960 vxworks versions > 5.0 with coff, not
3285         bout.  Default with no version number is still bout.  Support
3286         explicit i960-coff target too.
3287
3288         * bout.c: Changed some indentation, deleted trailing whitespace,
3289         fixed some comments, removed some "#if 1" lines.
3290         (output_addr): New macro.
3291         (calljx_callback, callj_callback, get_value, abs32code, aligncode,
3292         b_out_get_relocated_section_contents): Use it for readability.
3293
3294 Tue Feb 15 09:00:16 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3295
3296         * som.c (som_bfd_prep_for_ar_write): Iterate through the SOM
3297         symbols, not the BFD symbols.
3298         (som_bfd_ar_write_symbol_stuff): Likewise.
3299
3300 Mon Feb 14 22:55:20 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3301
3302         * som.c (som_slurp_symbol_table): Do not die if a BFD doesn't
3303         have any symbols.
3304
3305         * Finish basic read-write support for SOM archive libraries.  Bugs
3306         surely remain as this hasn't been tested all that much.
3307         * som.c (SOM_LST_HASH_SIZE, SOM_LST_MODULE_LIMIT): Define.
3308         (struct som_misc_symbol_info): New structure to hold info necessary
3309         to build both normal and library symbol tables.
3310         (som_derive_misc_symbol_info): New function to derive info necessary
3311         to build both normal and library symbol tables.
3312         (som_build_and_write_symbol_table): Use new function to derive misc
3313         symbol information.
3314         (som_slurp_symbol_table): Update backend private data for symbols
3315         appropriately.
3316         (som_bfd_prep_for_ar_write): New function.
3317         (som_bfd_ar_symbol_hash): New function.
3318         (som_bfd_ar_write_symbol_stuff): New function.
3319         (som_write_armap): Flesh out.
3320         (som_vec): Fix ar padding character.
3321
3322         * som.c: Consistently use memset rather than bzero.
3323
3324 Mon Feb 14 17:02:28 1994  Stu Grossman  (grossman at cygnus.com)
3325
3326         * coff-rs6000.c:  Add Lynx core file support, use HOST_AIX, where
3327         appropriate.
3328         * rs6000-core.c:  Use HOST_AIX instead of COREFILES_PLEASE.
3329         * config/rs6000.mh:  Remove defs of ARCHIVES_PLEASE and
3330         COREFILES_PLEASE.
3331         * config/rs6000lynx.mh:  Turn on Lynx core file support.
3332         * hosts/rs6000.h:  #define HOST_AIX.
3333         * hosts/rs6000lynx.h:  Create this to enable Lynx host support.
3334
3335 Sun Feb 13 14:30:00 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3336
3337         * som.h (som_symbol_data): Safely access backend private data
3338         for BFD symbols.  All callers changed.
3339
3340         * Read-only SOM archive support.
3341         * som.c (som_bfd_count_ar_symbols): New helper function.
3342         (som_bfd_fill_in_ar_symbols): New helper function.
3343         (som_slurp_armap): New function to read a SOM LST.
3344
3345         * som.h: Include <lst.h> and <ar.h>.
3346
3347 Sat Feb 12 22:34:14 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3348
3349         * elfcode.h (elf_map_symbols): Fix typo.
3350         (write_object_contents): Check return values from prep_headers and
3351         elf_compute_section_file_positions.
3352         (set_section_contents): Likewise.
3353
3354 Fri Feb 11 16:56:50 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3355
3356         * archive.c (normalize) [VMS]: Call malloc, not bfd_xmalloc.
3357         (bfd_construct_extended_name_table): Check result of normalize.
3358
3359 Tue Feb  8 08:57:31 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3360
3361         Make all callers of malloc or realloc (including via obstacks)
3362         check the result for NULL.  Most set bfd_error to no_memory and
3363         return in that case; a few are harder to fix, and are marked
3364         with "FIXME <return type>".
3365
3366         * elf32-hppa.c (hppa_elf_build_arg_reloc_stub
3367         hppa_elf_build_long_branch_stub):  Check bfd_make_empty_symbol return.
3368         * linker.c (_bfd_generic_link_output_symbols
3369         _bfd_generic_link_write_global_symbol): Ditto
3370         * section.c (bfd_make_section_anyway): Ditto.
3371
3372         * tekhex.c (find_chunk tekhex_mkobject): Check bfd_alloc.
3373         (first_phase): Ditto.  FIXME void
3374         (tekhex_make_empty_symbol): Check bfd_zalloc.
3375
3376         * sunos.c (sunos_read_dynamic_info): Check bfd_zalloc.
3377         (MY(read_dynamic_symbols) MY(read_dynamic_relocs)): Check bfd_alloc.
3378
3379         * stringhash.c (_bfd_stringtab_hash_newfunc): Check bfd_hash_allocate.
3380
3381         * srec.c: Indent.
3382         (fillup_symbols): Check bfd_alloc.  FIXME void
3383         (srec_mkobject srec_get_section_contents
3384         srec_set_section_contents): Check bfd_alloc. 
3385         (srec_make_empty_symbol): Check bfd_zalloc.
3386
3387         * som.c (hppa_som_gen_reloc_type): Check bfd_alloc_by_size_t.
3388         (make_unique_section): Check bfd_alloc.
3389         (som_new_section_hook): Check bfd_zalloc.
3390         (bfd_som_attach_aux_hdr): Ditto.  FIXME void
3391
3392         * rs6000-core.c (rs6000coff_core_p): Check bfd_zalloc.
3393
3394         * osf-core.c (osf_core_make_empty_symbol): Check bfd_zalloc.
3395         (osf_core_core_file_p): Check bfd_alloc.
3396
3397         * oasys.c (oasys_slurp_symbol_table oasys_archive_p
3398         oasys_mkobject oasys_object_p oasys_new_section_hook
3399         oasys_set_section_contents): Check bfd_alloc.
3400         (oasys_slurp_section_data): Check bfd_zalloc and bfd_alloc.
3401         (oasys_make_empty_symbol): Check bfd_zalloc.
3402
3403         * nlmcode.h (nlm_make_empty_symbol): Check bfd_zalloc.
3404         (nlm_slurp_symbol_table): Check bfd_zalloc and bfd_alloc.
3405
3406         * nlm32-sparc.c (nlm_sparc_read_import): Check bfd_alloc.
3407
3408         * nlm32-i386.c (nlm_i386_read_import): Check bfd_alloc.
3409
3410         * nlm32-alpha.c (nlm_alpha_read_import): Check bfd_alloc.
3411
3412         * linker.c (_bfd_link_hash_newfunc
3413         (generic_link_hash_newfunc
3414         (archive_hash_newfunc
3415         (_bfd_generic_link_add_one_symbol): Check bfd_hash_allocate.
3416         (_bfd_generic_final_link
3417         (_bfd_generic_link_output_symbols
3418         (default_indirect_link_order): Check bfd_alloc.
3419         (bfd_new_link_order): Check bfd_alloc_by_size_t.
3420
3421         * irix-core.c (irix_core_make_empty_symbol): Check bfd_zalloc.
3422
3423         * ieee.c: Indent.
3424         (read_id get_symbol get_section_entry ieee_archive_p ieee_object_p
3425         ieee_slurp_section_data ieee_new_section_hook): Check bfd_alloc.
3426         (do_one): Check bfd_alloc.  Return a boolean.
3427         (ieee_slurp_section_data): Check it.
3428         (init_for_output): Check bfd_alloc.  Return a boolean.
3429         (ieee_set_section_contents): Check it.
3430         (do_with_relocs):  Check bfd_alloc.  Return a boolean.
3431         (ieee_bfd_debug_info_accumulate): Ditto.  FIXME void.
3432         (ieee_mkobject): Check bfd_zalloc.
3433         (ieee_make_empty_symbol): Check bfd_zmalloc.
3434
3435         * hpux-core.c (hpux_core_make_empty_symbol): Check
3436         bfd_zalloc.
3437
3438         * hppabsd-core.c (hppabsd_core_make_empty_symbol): Check
3439         bfd_zalloc.
3440         (hppabsd_core_core_file_p): Check bfd_zalloc.
3441
3442         * hp300hpux.c (MY(slurp_symbol_table)): Check bfd_alloc.
3443
3444         * elfcode.h (elf_new_section_hook): Check bfd_alloc.
3445         (bfd_section_from_phdr): Ditto.
3446         (write_relocs): Ditto.  FIXME void
3447         (elf_map_symbols assign_section_numbers map_program_segments):
3448         Ditto.  Return a boolean. 
3449         (swap_out_syms): Ditto.  Check elf_map_symbols.
3450         (elf_slurp_symbol_table): Check bfd_zalloc.
3451         (elf_slurp_reloca_table): Check bfd_alloc.
3452         (elf_slurp_reloc_table): Ditto.
3453         (elf_compute_section_file_positions): Check assign_section_numbers.
3454         (assign_file_positions_except_relocs): Return a boolean.
3455         Check map_program_segments.
3456         (elf_compute_section_file_positions): Check it.
3457
3458         * elf32-mips.c (mips_elf_final_link): Check bfd_alloc.
3459
3460         * elf32-hppa.c (hppa_elf_stub_branch_reloc): Check bfd_zmalloc and
3461         realloc. 
3462         (hppa_elf_stub_reloc): Ditto.
3463         (hppa_elf_build_arg_reloc_stub): Check bfd_zalloc.
3464         (hppa_elf_build_long_branch_stub): Ditto.
3465         (elf32_hppa_backend_symbol_table_processing): Ditto.
3466
3467         * ecoff.c (ecoff_set_symbol_info): Check bfd_alloc.  Return a boolean.
3468         (ecoff_slurp_symbol_table): Check it.
3469         (ecoff_slurp_armap): Check bfd_alloc.
3470         (ecoff_write_armap): Check bfd_zalloc.
3471         (ecoff_link_hash_newfunc): Check bfd_hash_allocate and
3472         _bfd_link_hash_newfunc. 
3473         (ecoff_link_add_externals): Check bfd_alloc.
3474
3475         * ctor.c (bfd_constructor_entry): Check bfd_alloc.
3476
3477         * coffgen.c (coff_real_object_p): Check bfd_alloc.
3478         (coff_renumber_symbols): Check bfd_alloc_by_size_t.  Return a boolean.
3479         (coff_write_symbol): Check bfd_alloc.  FIXME int
3480         (coff_write_linenumbers): Check bfd_alloc.  Return a boolean.
3481         (coff_section_symbol): Check bfd_alloc_by_size_t.
3482         (coff_get_normalized_symtab): Check bfd_alloc.
3483         (coff_bfd_make_debug_symbol): Check bfd_zalloc.
3484         * libcoff-in.h: Change decls of coff_renumber_symbols,
3485         coff_write_linenumbers.
3486         * libcoff.h: Rebuilt.
3487         * coffcode.h (coff_write_object_contents): Check
3488         coff_renumber_symbols, coff_write_linenumbers.
3489
3490         * coffcode.h: Indent.
3491         (coff_add_missing_symbols): Check bfd_alloc_by_size_t.  Return a
3492         boolean. 
3493         (coff_write_object_contents): Check it.
3494
3495         * coff-alpha.c (alpha_relocate_section): Check bfd_alloc.
3496         * coff-mips.c (mips_relocate_section): Ditto.
3497
3498         * archive.c (bfd_slurp_bsd_armap_f2): Check bfd_alloc value.
3499         (do_slurp_bsd_armap): Ditto.
3500         (compute_and_write_armap): Check bfd_realloc value.
3501
3502         * aoutx.h (translate_from_native_sym_flags): Check bfd_alloc
3503         return value.  Return boolean value.
3504         (NAME(aout,make_empty_symbol)): Check bfd_zalloc return value.
3505         (NAME(aout,slurp_symbol_table)): Check bf_alloc and bfd_zalloc
3506         return value.
3507         (add_to_stringtab): Ditto.  FIXME void
3508         (aout_link_hash_newfunc): Check bfd_hash_allocate return value.
3509         (aout_link_add_symbols): Check bfd_alloc value.
3510         (translate_symbol_table): Check translate_from_native_sym_flags.
3511         * hp300hpux.c (MY(slurp_symbol_table)): Ditto.
3512         * aoutx.h (aout_link_hash_newfunc): Check _bfd_link_hash_newfunc.
3513
3514         * opncls.c (bfd_zalloc bfd_realloc): Check result of bfd_alloc.
3515
3516         * opncls.c (obstack_chunk_alloc): Define as malloc, not
3517         bfd_xmalloc_by_size_t. 
3518         (_bfd_new_bfd): Check obstack_begin for 0 return.
3519
3520         * ieee.c (obstack_chunk_alloc): Define as malloc, not
3521         bfd_xmalloc_by_size_t. 
3522         (ieee_archive_p): Check obstack_begin for 0 return and
3523         obstack_finish for NULL return.
3524
3525         * hash.c (obstack_chunk_alloc): Define as malloc, not
3526         bfd_xmalloc_by_size_t. 
3527         (bfd_hash_table_init_n): Check obstack_begin for 0 return and
3528         obstack_finish for NULL return.
3529         (bfd_hash_lookup): Check obstack_alloc for NULL return.
3530
3531         * ecofflink.c (obstack_chunk_alloc): Define as malloc, not
3532         bfd_xmalloc_by_size_t. 
3533         bfd_ecoff_debug_accumulate
3534         bfd_ecoff_debug_accumulate_other): Check obstack_alloc.
3535         (add_file_shuffle add_memory_shuffle): Check obstack_alloc for
3536         NULL return.  Return boolean, not void.
3537         (bfd_ecoff_debug_init): Check obstack_begin for 0 return.
3538         (bfd_ecoff_debug_accumulate): Check add_file_shuffle
3539         and add_memory_shuffle return. 
3540         (string_hash_newfunc): Check bfd_hash_allocate and bfd_hash_newfunc.
3541         (bfd_ecoff_debug_accumulate): Check bfd_alloc.
3542         (ecoff_add_string): Check add_memory_shuffle return.
3543
3544         * libbfd-in.h (xmalloc, bfd_xmalloc, bfd_xmalloc_by_size_t):
3545         Remove decls. 
3546         * libbfd.h: Rebuilt.
3547
3548 Fri Feb 11 15:35:32 1994  Stu Grossman  (grossman at cygnus.com)
3549
3550         * configure.host:  Add Lynx/rs6000 support.
3551         * config/i386-nlm.mt:  Enable a.out file support.
3552         * config/rs6000lynx.mh:  Lynx/rs6000 host support.
3553
3554 Fri Feb 11 17:25:58 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3555
3556         * archive.c (compute_and_write_armap): Rewrite somewhat to improve
3557         memory usage.
3558
3559 Fri Feb 11 13:10:42 1994  Stan Shebs  (shebs@andros.cygnus.com)
3560
3561         * archive.c: Change all references to '\n' in archive magic
3562         to '\012', for greater portability.
3563         * ecoff.c (ecoff_write_armap): Ditto.
3564
3565 Thu Feb 10 12:58:48 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3566
3567         * aoutx.h (aout_link_write_other_symbol): Check strip settings to
3568         see whether symbol should be output.
3569         * genlink.h (struct generic_write_global_symbol_info): Added info
3570         field.
3571         * linker.c (_bfd_generic_final_link): Initialize wginfo.info.
3572         (_bfd_generic_link_write_global_symbol): Check strip settings to
3573         see whether symbol should be output.
3574         * elf32-mips.c (mips_elf_final_link): Initialize wginfo.info.
3575
3576 Wed Feb  9 21:34:58 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3577
3578         * som.c (som_reloc_queue_find): Do not examine a NULL queue entry.
3579
3580         * som.c: Cast return values from BFD memory allocation routines to
3581         avoid warnings from the HP compiler.
3582
3583 Wed Feb  9 12:55:02 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3584
3585         * coff-alpha.c (alpha_relocate_section): Accept a LITERAL
3586         reloc on an "ldl" instruction too.
3587
3588         * archive.c (bfd_ar_hdr_from_filesystem): Cast status elements
3589         when passing them to sprintf.  Use %ld instead of %d.
3590
3591         * coff-rs6000.c (rs6000coff_mkarchive): Return false.
3592         (rs6000_coff_snarf_ar_hdr): Don't declare errno; it's not used.
3593         Also removed unused variable namelen.
3594         (rs6000coff_write_armap): Declare orl_count and stridx parameters.
3595
3596 Tue Feb  8 18:00:34 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3597
3598         * libbfd-in.h (xmalloc): Don't declare parameter type, to avoid
3599         conflicts.
3600         * libbfd.h: Rebuilt.
3601
3602 Tue Feb  8 15:55:50 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
3603
3604         * coff-alpha.c (reloc_nil): New function.
3605         (alpha_howto_table): Use it as special_function to prevent certain
3606         relocs from being adjusted by bfd_perform_relocation.  IGNORE
3607         reloc should be partial_inplace.
3608         (alpha_ecoff_get_relocated_section_contents): Accept a LITERAL
3609         reloc on an "ldl" instruction too.
3610
3611 Tue Feb  8 00:32:28 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3612
3613         * elf32-hppa.c (CURRENT_STUB_OFFSET, hppa_elf_build_arg_reloc_stub,
3614         hppa_elf_build_long_branch_stub):  Cast to char * instead of int
3615         before performing pointer arithmetic.
3616
3617 Mon Feb  7 20:56:27 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
3618
3619         * config.bfd (hppa*-*-osf*): Use bfd_name hppaosf for this
3620         configuration.
3621         (hppa*-*-*elf*): This configuration used hppa-elf now.
3622
3623         * som.c: This file is also used for HOST_HPPAOSF.
3624
3625         * targets.c (bfd_target_vector): Enable som_vec for HOST_HPPAOSF.
3626
3627         * hosts/hppaosf.h: New host configuration file.
3628
3629         * config/hppabsd.mt (SELECT_VECS): Add bfd_elf32_hppa_vec as
3630         BSD handles both SOM and ELF object files.
3631
3632         * config/hppaosf.mh (HDEFINES): Delete.  No longer needed.
3633         (RANLIB): Doesn't do anything, define it to be "echo".
3634
3635         * config/hppaosf.mt: New target makefile fragment for a PA running
3636         OSF1.
3637
3638 Mon Feb  7 15:02:06 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3639
3640         * archures.c (enum bfd_architecture): Added bfd_arch_powerpc.
3641         (archures_init_table): If SELECT_ARCHITECTURES is not defined,
3642         added bfd_powerpc_arch.
3643         * bfd-in2.h: Rebuilt.
3644         * cpu-powerpc.c: New file.
3645         * Makefile.in (ALL_MACHINES, CFILES): Added cpu-powerpc.c.
3646         Rebuilt dependencies.
3647
3648         * elfcode.h (bfd_section_from_shdr): Get vma and alignment_power
3649         of an SHT_STRTAB section from sh_addr and sh_addralign, rather
3650         than just setting them to zero.
3651
3652 Sun Feb  6 20:04:10 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3653
3654         * elfcode.h (prep_headers, swap_out_syms): Check for NULL return
3655         from bfd_new_strtab. 
3656         (elf_compute_section_file_positions): Check for false return from
3657         swap_out_syms. 
3658
3659         * linker.c (default_indirect_link_order): Check for NULL return
3660         from bfd_get_relocated_section_contents.
3661
3662         * syms.c: Make example application in doc call xmalloc, not
3663         bfd_xmalloc. 
3664
3665         * aoutx.h (NAME(aout,slurp_symbol_table),
3666         aout_link_get_symbols, NAME(aout,link_hash_table_create)):
3667         * bout.c (b_out_slurp_reloc_table, b_out_squirt_out_relocs):
3668         * ecoff.c (ecoff_bfd_link_hash_table_create): 
3669         * ecofflink.c (bfd_ecoff_debug_init): 
3670         * format.c (bfd_check_format_matches): 
3671         * linker.c (_bfd_generic_link_hash_table_create): 
3672         (_bfd_generic_final_link): 
3673         * reloc16.c (bfd_coff_reloc16_relax_section): 
3674         (bfd_coff_reloc16_get_relocated_section_contents): 
3675         * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): 
3676         * elf32-mips.c (mips_elf_final_link): 
3677         * elfcode.h (bfd_new_strtab): 
3678         (bfd_add_2_to_strtab): 
3679         (elf_slurp_symbol_table): 
3680         (elf_corefile_note): 
3681         * libbfd.c (bfd_zmalloc): 
3682         Use malloc and check the result, instead of bfd_xmalloc.
3683
3684 Sat Feb  5 12:39:28 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
3685
3686         * config.bfd: Put m68*-*-sysv* line after m68*-*-sysv4*.
3687
3688 Sat Feb  5 05:32:44 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
3689
3690         * srec.c (srec_write_record):  Put CONST keyword for "src" before
3691         "unsigned", some compilers don't like it after "unsigned".
3692         * libcoff.h, libcoff-in.h (bfd_perform_slip):  Rename "value" to
3693         "val" in prototype declaration because some compilers don't like
3694         arguments whose names are the same as types.
3695
3696 Sat Feb  5 01:14:38 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3697
3698         * aoutx.h (aout_link_check_ar_symbols): Correct test for whether
3699         object file defines symbol.  Also, if skipping a symbol, skip the
3700         second symbol of a N_WARNING or N_INDR symbol as well.
3701
3702 Fri Feb  4 23:55:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3703
3704         Add basic support for writing RS/6000 XCOFF files.
3705         * coff-rs6000.c (dummy_reloc): Removed.
3706         (rs6000coff_howto_table): Defined XCOFF relocs.
3707         (RTYPE2HOWTO): Defined to use rs6000coff_rtype2howto.
3708         (rs6000coff_rtype2howto): New function.
3709         (coff_bfd_reloc_type_lookup): Defined to use
3710         rs6000coff_reloc_type_lookup. 
3711         (rs6000coff_reloc_type_lookup): New function.
3712         (SELECT_RELOC): Defined to set r_type and r_size fields.
3713         (COFF_LONG_FILENAMES): Defined.
3714         * coffcode.h (combined_entry_type): Changed fix_tag and fix_end
3715         fields to bitfields.  Added fields fix_value and fix_scnlen.
3716         (sec_to_styp_flags): If STYP_DEBUG is defined, use it rather than
3717         STYP_INFO for the type of a section named .debug.
3718         (coff_add_missing_symbols): Don't define if RS6000COFF_C.
3719         (coff_write_object_contents): If RS6000COFF_C, don't call
3720         coff_add_missing_symbols.
3721         (coff_slurp_symbol_table): If RS6000COFF_C, then if the last aux
3722         entry has type STY_LD change the x_scnlen into a pointer to a
3723         symbol and set fix_scnlen.  Also, for a C_BSTAT symbol, change the
3724         value into a pointer to a symbol and set fix_value.
3725         * libcoff.h: Rebuilt.
3726         * coffgen.c (coff_mangle_symbols): Reindent.  If fix_value is set,
3727         get the symbol offset. Likewise for fix_scnlen.
3728         (string_size): Change type to bfd_size_type.
3729         (debug_string_size, debug_string_section): New static variables.
3730         (coff_fix_symbol_name): If bfd_coff_symname_in_debug returns true,
3731         write the symbol name into the .debug section; assume that the
3732         section has already been created with the right size.
3733         (coff_write_symbols): Initialize debug_string_size to 0.  If
3734         bfd_coff_symname_in_debug returns true, don't put symbol name in
3735         usual string table.  After writing out all symbols, if
3736         debug_string_size is not 0, check that it matches the size of the
3737         .debug section.
3738         (coff_get_normalized_symtab): Clear new fix_value and fix_scnlen
3739         fields.  If the string offset is 0, always use an empty string as
3740         the name.
3741         (coff_make_empty_symbol): Zero out the symbol structure.
3742         * reloc.c (bfd_perform_relocation): Work around one gross hack
3743         with another: actually look at the target name to avoid the broken
3744         COFF check.
3745         (bfd_reloc_code_real_type): Add BFD_RELOC_PPC_B26,
3746         BFD_RELOC_PPC_BA26 and BFD_RELOC_PPC_TOC16.
3747         * bfd-in2.h: Rebuilt.
3748
3749 Fri Feb  4 17:28:32 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3750
3751         * libbfd.c (bfd_zmalloc): Call bfd_xmalloc instead of malloc.
3752         (bfd_xmalloc, bfd_xmalloc_by_size_t): Functions deleted.
3753         * libbfd-in.h: Define them as macros calling xmalloc and declare
3754         xmalloc. 
3755         * libbfd.h: Rebuilt.
3756
3757 Thu Feb  3 16:49:35 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3758
3759         * ecofflink.c (bfd_ecoff_debug_externals): If a small undefined
3760         symbol has a value in the ECOFF symbol but not in the BFD symbol,
3761         keep the value in the ECOFF symbol.  This helps gas.
3762
3763         * linker.c (_bfd_generic_link_output_symbols,
3764         _bfd_generic_link_write_global_symbol): Don't require that all
3765         references to a common symbol be themselves common symbols.
3766
3767         * aoutx.h (aout_reloc_index_to_section): Handle N_UNDF.
3768
3769 Wed Feb  2 20:37:19 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
3770
3771         * libbfd.c, bfd-in.h, hosts/alphaosf.h, hosts/sparc-ll.h, aoutf1.h,
3772         sparclynx.c, Makefile.in: Change HOST_64_BIT to BFD_HOST_64_BIT.
3773         * bfd-in2.h: Rebuilt.
3774
3775 Wed Feb  2 12:30:13 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3776
3777         * coffswap.h (coff_swap_reloc_out): If RS6000COFF_C, handle type
3778         and size correctly.
3779         (coff_swap_aux_in): If RS6000COFF_C, change x_csect.x_scnlen to
3780         x_csect.x_scnlen.l to match change in coff/internal.h.
3781         (coff_swap_aux_out): Likewise.
3782
3783         * coff-mips.c (mips_ecoff_backend_data), coff-alpha.c
3784         (alpha_ecoff_backend_data): Change casts of aux_in and aux_out
3785         fields to match yesterday's changes.
3786
3787         * coffcode.h (coff_write_relocs): If SELECT_RELOC is defined, pass
3788         in the internal_reloc itself, not the type.
3789         * coff-apollo.c, coff-h8300.c, coff-h8500.c, coff-i386.c,
3790         coff-m68k.c, coff-sh.c, coff-we32k.c, coff-z8k.c: Changed
3791         definition of SELECT_RELOC accordingly.
3792
3793 Tue Feb  1 12:05:44 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3794
3795         * coffcode.h (bfd_coff_backend_data): Added new arguments to
3796         _bfd_coff_swap_aux_in and _bfd_coff_swap_aux_out: aux index number
3797         and number of aux entries.
3798         (bfd_coff_swap_aux_in, bfd_coff_swap_aux_out): Changed
3799         accordingly.
3800         * libcoff.h: Rebuilt.
3801         * coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Accept new
3802         arguments.  If RS6000COFF_C, only treat C_EXT and C_HIDEXT
3803         specially if this is the last aux entry.
3804         * coffgen.c (coff_write_symbol, coff_get_normalized_symtab): Pass
3805         new arguments to swap_aux functions.
3806
3807 Sun Jan 30 15:14:36 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
3808
3809         * gen-aout.c (main): Set DEFAULT_ARCH based on preprocessor macros
3810         (only testing for m68k and vax at the moment); do verify that the
3811         preprocessor didn't trash the arch name inside the string version.
3812         Don't print out "pagesize =" line that prevents output from
3813         compiling.  Derive BYTES_IN_WORD and ARCH values from sizeof
3814         results.
3815         * Makefile.in (aout-params.h): Pass gen-aout a dummy target name.
3816         (check, installcheck): Identify directory in "no testsuites"
3817         message.
3818
3819 Sun Jan 30 13:25:28 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3820
3821         * aoutx.h (aout_link_write_symbols): Write out correct value for
3822         object file symbol.
3823
3824 Fri Jan 28 18:34:05 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
3825
3826         * hosts/vaxbsd.h (HOST_STACK_END_ADDR): Vax BSD doesn't define
3827         KERNBASE, so hard-code 0x80000000 instead.
3828
3829 Thu Jan 27 13:54:08 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3830
3831         * linker.c (generic_link_add_symbol_list): If symbol is common,
3832         set the BSF_OLD_COMMON flag.
3833
3834 Wed Jan 26 13:47:15 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3835
3836         * format.c (bfd_check_format_matches): Put the new entry in the
3837         correct element of matching_vector.
3838
3839 Tue Jan 25 11:43:28 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
3840
3841         * som.c, som.h (bfd_som_set_section_attributes,
3842         bfd_som_set_subsection_attributes): Change parameters from char
3843         to int.  Following a prototype with an old-style function definition
3844         in the presence of widened parameters is a GCC-ism not supported
3845         by the HP compiler in ANSI mode.
3846
3847 Tue Jan 25 11:46:46 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3848
3849         * reloc.c (bfd_get_reloc_size): Size of type -2 is 4 bytes, not 2.
3850
3851         * hp300hpux.c (MY(write_object_contents)): Write out the symbols
3852         before writing out the relocs, so that the right symbol indices
3853         are used.
3854
3855         * archive.c (do_slurp_bsd_armap, bfd_slurp_bsd_armap_f2): Do not
3856         try to overlay the internal carsyms on the external symdefs.  That
3857         can not work if the size of a host pointer is larger than 4 bytes.
3858
3859         * format.c (bfd_check_format_matches): Cast result of
3860         bfd_xmalloc_by_size_t.
3861         * opncls.c (_bfd_new_bfd): Avoid ANSI C prototype.
3862
3863         * archive.c: Reindented to GNU standards.
3864
3865 Mon Jan 24 14:41:23 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3866
3867         * opncls.c (_bfd_new_bfd, _bfd_new_bfd_contained_in): Add
3868         "_bfd_" to function names.
3869         * archive.c (_bfd_create_empty_archive_element_shell),
3870         libbfd-in.h: Change callers.
3871
3872         * libbfd.c (bfd_zmalloc): Renamed from zalloc.
3873         * libbfd.c (bfd_add_to_string_table),
3874         trad-core.c (trad_unix_core_file_p),
3875         targets.c (bfd_target_list),
3876         ptrace-core.c (ptrace_unix_core_file_p),
3877         opncls.c (new_bfd), libbfd-in.h,
3878         ieee.c (ieee_make_empty_symbol),
3879         elf32-hppa.c (hppa_elf_stub_branch_reloc),
3880         (hppa_elf_stub_reloc): Change callers.
3881         * libbfd.h: Regenerated.
3882
3883         * archive.c (_bfd_look_for_bfd_in_cache): Add "_bfd_" to name.
3884         (_bfd_get_elt_at_filepos), 
3885         coff-rs6000.c (rs6000coff_get_elt_at_filepos), libbfd-in.h:
3886         Change callers.
3887
3888         * format.c (bfd_check_format_matches), libbfd-in.h, targets.c,
3889         elfcode.h (elf_object_p): Rename target_vector to bfd_target_vector
3890         and default_vector to bfd_default_vector.
3891         * libbfd.h: Regenerated.
3892
3893         * format.c (bfd_check_format_matches): New function.
3894         (bfd_check_format): Call it.
3895         (bfd_matching_formats): Function removed.
3896         * targets.c: Replace the vector added on Jan 21 with a count of
3897         entries in default_vector.
3898         * bfd-in2.h: Regenerated.
3899
3900 Mon Jan 24 12:38:54 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
3901
3902         * coff-alpha.c (alpha_ecoff_object_p): New function.  Set size of
3903         .pdata section based on lnnoptr field, not section header.
3904         (alpha_relocate_section): Don't bother to check if r_symndx >= 0,
3905         since it is unsigned.
3906         (ecoffalpha_little_vec): Use alpha_ecoff_object_p rather than
3907         coff_object_p.
3908         * ecoff.c (ecoff_new_section_hook): Set alignment_power field of
3909         .pdata section to 3.
3910         (ecoff_compute_section_file_positions): Save the size of the
3911         .pdata section in the line_filepos field, and actually align the
3912         .pdata section to an alignment power of 4.
3913         (ecoff_compute_reloc_file_positions): Set output_has_begun after
3914         calling ecoff_compute_section_file_positions.
3915         (ecoff_write_object_contents): Set s_lnnoptr for the .pdata
3916         section from the line_filepos field.  Set vstamp for the optional
3917         header from the vstamp of the symbolic header.
3918         (ecoff_bfd_final_link): Set vstamp of the symbolic header to the
3919         vstamp used by the first object file in the link.
3920
3921         * ecofflink.c (ecoff_align_debug): Align RFDs to debug_align.
3922
3923         * linker.c (generic_link_check_achive_element): Set SEC_ALLOC flag
3924         for a created common section.
3925         (_bfd_generic_link_add_one_symbol): Likewise.
3926
3927         * elfcode.h (swap_out_syms): Use elf_section_from_bfd_section to
3928         get the index of a common section, rather than always using
3929         SHN_COMMON (MIPS has multiple common sections).
3930
3931         * elf32-hppa.c (hppa_elf_gen_reloc_type): Typo (== for =).
3932
3933         * bfd/aoutx.h (aout_link_input_section_std,
3934         aout_link_input_section_ext): Pass additional arguments to
3935         reloc_overflow callback.
3936         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents,
3937         alpha_relocat_section): Likewise.
3938         * coff-h8300.c (h8300_reloc16_extra_cases): Likewise.
3939         * coff-h8500.c (extra_case): Likewise.
3940         * coff-mips.c (mips_relocate_section): Likewise.
3941         * coff-z8k.c (extra_case): Likewise.
3942         * elf32-hppa.c (hppa_elf_stub_finish): Likewise.
3943         * reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
3944
3945         * bout.c (calljx_callback, callj_callback): Use get_value to get
3946         the symbol value and check for undefined symbols.
3947         (get_value): If the symbol is undefined, look it up in the linker
3948         hash table.
3949         (b_out_get_relocated_section_contents): For PCREL24 and PCREL13
3950         use get_value to get the symbol value and check for undefined
3951         symbols.
3952         * reloc16.c (bfd_coff_reloc16_get_value): If the symbol is
3953         undefined, look it up in the linker hash table.
3954
3955         * aoutx.h (translate_symbol_table): The string index 0 has a
3956         special meaning for normal symbols, but not for dynamic symbols.
3957
3958 Sat Jan 22 12:26:01 1994  Stu Grossman  (grossman at cygnus.com)
3959
3960         * sparclynx.c:  Setup appropriate macros to enable core file
3961         support.
3962
3963 Fri Jan 21 16:25:35 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3964
3965         * targets.c: Add a vector of matching format names.
3966         * format.c (bfd_matching_formats): New function to return it.
3967         (bfd_check_format): Set it.
3968         * bfd-in2.h: Regenerated.
3969
3970         * bfd-in.h: Remove decls of bfd_ec type and error printing functions.
3971         Remove decl of type symclass; wasn't used.
3972         * bfd.c: Document error handling, including code fragments
3973         containing the error decls that were in bfd-in.h.
3974         Remove DEFUNs.
3975         * bfd-in2.h: Regenerated.
3976
3977 Fri Jan 21 14:11:16 1994  Sean Fagan  (sef@cygnus.com)
3978
3979         * nlmcode.h, liblnm.h, nlm32-alpha.c nlm32-i386.c nlm32-sparc.c:
3980         The sparc (and possibly other?) NLM format requires a different
3981         way to write exports, so add a write_export field to the backend
3982         data (and set it to NULL for everything but the sparc).
3983
3984 Fri Jan 21 14:11:16 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
3985
3986         * sunos.c (MY(read_dynamic_relocs)): Compare info->dynrel with NULL,
3987         not (struct external_nlist *) NULL.  info->dynrel is a PTR, not
3988         a struct external_nlist *.
3989
3990 Fri Jan 21 09:29:01 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
3991
3992         * bfd.c: Remove error strings for errors removed below.
3993         * aoutx.h (translate_to_native_sym_flags), bfd-in.h (bfd_ec),
3994         oasys.c (oasys_write_sections): Rename
3995         bfd_error_nonrepresentable_section to nonrepresentable_section.
3996         None of the other bfd error names start with "bfd_error".
3997         Remove errors symbol_not_found and no_relocation_info, which seem
3998         to be unused.
3999         * bfd-in2.h: Regenerated.
4000
4001 Fri Jan 21 01:11:55 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4002
4003         * bfd.c (bfd_get_gp_size): Added support for ELF.
4004
4005         * syms.c (BSF_DYNAMIC): New symbol flag.
4006         (bfd_print_symbol_vandf): Print it.
4007         * bfd-in2.h: Rebuilt.
4008         * libaout.h (struct aout_backend_data): New read_dynamic_symbols
4009         and read_dynamic_relocs fields.
4010         (struct aoutdata): New dynamic_info field.
4011         (obj_aout_dynamic_info): New accessor macro.
4012         * sunos.c (struct sunos_dynamic_info): New structure.
4013         (sunos_read_dynamic_info, MY(read_dynamic_symbols),
4014         MY(read_dynamic_relocs)): New functions to read dynamic symbols
4015         and relocs.
4016         * aoutx.h (NAME(aout,some_aout_object_p)): If the object is
4017         dynamically linked, set SEC_RELOC for both the .text and .data
4018         sections.
4019         (translate_from_native_sym_flags): Don't set BSF_LOCAL for an
4020         undefined symbol.
4021         (translate_symbol_table): New function, split out of
4022         slurp_symbol_table; set the BSF_DYNAMIC flag appropriately.
4023         (NAME(aout,slurp_symbol_table)): Read dynamic symbols, if any.
4024         (NAME(aout,slurp_reloc_table)): Read dynamic relocs, if any.
4025         (NAME(aout,get_reloc_upper_bound)): Include dynamic reloc count in
4026         return value.
4027         * aoutf1.h (NAME(aout,sunos4_write_object_contents)): Don't write
4028         out dynamic symbols or relocs against reloc symbols, since they
4029         are already in the .text section and we wouldn't know where to
4030         write them anyhow.
4031         (sunos4_aout_backend): Initialize read_dynamic_symbols and
4032         read_dynamic_relocs fields.
4033         * aout-target.h (MY(backend_data)): Initialize
4034         read_dynamic_symbols and read_dynamic_relocs fields.
4035
4036 Thu Jan 20 20:57:27 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
4037
4038         * hosts/alphaosf.h (uint64e_type, uint64_type, int64_type): Delete
4039         typedefs, since HOST_64_BIT will take care of defining them in
4040         bfd.h.
4041
4042 Wed Jan 19 17:28:59 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
4043
4044         * config/alphaosf.mh (HDEFINES): Don't define HOST_64_BIT here;
4045         that's dealt with elsewhere.
4046         * hosts/alphaosf.h (sprintf_vma, fprintf_vma): New macros.
4047         (uint64_typeHIGH, uint64_typeLOW): Comment with HOST_64_BIT so
4048         they get copied to bfd.h.
4049
4050         * reloc.c (enum bfd_reloc_code_real): Add some Alpha relocation
4051         types.  Reorganized some of the existing ones.
4052         * coff-alpha.c (alpha_howto_table): Construct 64-bit negative one
4053         values in case of compilation on a 32-bit machine.  Fix pcrel
4054         fields of some reloc types.
4055         (alpha_bfd_reloc_type_lookup): Handle more relocation types.
4056
4057         * bfd-in.h (uint64_typeHIGH, uint64_typeLOW): Supply default
4058         definitions when not defined, regardless of whether uint64_type is
4059         a defined macro or not.
4060         (fprintf_vma, sprintf_vma): Define only if fprintf_vma is not
4061         already defined.
4062
4063 Wed Jan 19 00:02:54 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4064
4065         * aoutx.h (translate_to_native_sym_flags): Set the type of a
4066         BSF_WARNING symbol to N_WARNING.
4067
4068 Tue Jan 18 16:43:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4069
4070         * aoutx.h (aout_link_add_symbols): Increment sym_hash as well as p
4071         for an indirect or warning symbol.
4072         (aout_link_write_symbols): Update sym_hash with the target of an
4073         indirect or warning symbol.  If an indirect symbol is defined,
4074         output the calculated value and don't output the target symbol.
4075
4076 Tue Jan 18 03:54:59 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4077
4078         * aoutx.h (translate_from_native_sym_flags): Give warning symbols
4079         an (unused) nonzero section value, needed for check below.
4080
4081 Mon Jan 17 15:12:07 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4082
4083         * aoutx.h (translate_from_native_sym_flags,
4084         aout_link_add_symbols): Treat N_SET[ABDT] | N_EXT like
4085         N_SET[ABDT].
4086
4087 Fri Jan 14 16:45:43 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4088
4089         * elfcode.h (elf_object_p): If there is a SHT_DYNAMIC section, set
4090         the DYNAMIC flag for the BFD.
4091         (NAME(bfd_elf,write_object_contents)): Don't try to write out a
4092         BFD with the DYNAMIC flag set, since we don't generate the program
4093         header table correctly.
4094
4095 Fri Jan 14 01:04:36 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
4096
4097         * elfcode.h (elf_slurp_symbol_table):  Free x_symp at the end
4098         of the function to avoid storage leak.
4099
4100 Thu Jan 13 23:07:32 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4101
4102         * ecoff.c (ecoff_link_write_external): An ifd can be -1.
4103
4104 Thu Jan 13 12:33:27 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
4105
4106         * som.c (som_set_reloc_info): Provide a default symbol for
4107         relocations which don't actually have an associated symbol.
4108
4109         * som.c (hppa_som_reloc): Add new "error message" argument.
4110
4111 Wed Jan 12 13:36:43 1994  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
4112
4113         Enable gdb to write to core files on more core file readers.
4114         * libbfd.c (bfd_generic_set_section_contents):  Remove range check
4115         for section size, it is already done in bfd_set_section_contents
4116         with bfd_get_section_size_now.
4117         * aix386-core.c, hppabsd-core.c, hpux-core.c, irix-core.c,
4118         osf-core.c, ptrace-core.c, trad-core.c (*_set_section_contents):
4119         Use bfd_generic_set_section_contents instead of bfd_false.
4120
4121 Wed Jan 12 15:31:57 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4122
4123         * linker.c: Added initial documentation.
4124
4125         * linker.c (default_indirect_link_order): Don't expect space for
4126         output relocations if there aren't any input relocations.
4127
4128 Tue Jan 11 14:37:12 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4129
4130         * aoutx.h (NAME(aout,final_link)): Set a_entry before computing
4131         file offsets.
4132
4133         * elfcode.h (swap_out_syms): A common symbol is STT_OBJECT, not
4134         STT_NOTYPE.
4135
4136 Tue Jan 11 09:10:56 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
4137
4138         * config.bfd: Use ELF, not COFF for m88*-*-dgux*.
4139         Combine m88k-*-* and m88110-*-* cases into m88*-*-*.
4140
4141 Tue Jan 11 00:07:19 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4142
4143         * ecofflink.c: Extensive changes to compress and merge debugging
4144         information, and to write some of out directly rather than saving
4145         it in memory.  Several new functions and structures, and new
4146         arguments to existing functions.
4147         * ecoff.c (ecoff_compute_reloc_file_positions): Compute
4148         sym_filepos as well.
4149         (ecoff_get_extr): Use ifdmap instead of ifdbase.
4150         (ecoff_write_object_contents): Don't compute sym_filepos here.
4151         Only output symbols if outsymbols is not NULL.
4152         (ecoff_bfd_final_link): Adjust for changes in ecoff_debug_info and
4153         bfd_ecoff_debug functions.  Write out debugging information here.
4154         (ecoff_final_link_debug_accumulate): Adjust for changes in
4155         bfd_ecoff_debug functions.
4156         (ecoff_link_write_external): Use ifdmap rather than ifdbase.
4157         * elf32-mips.c (mips_elf_read_ecoff_info): Read external symbols
4158         first, to put them in the first memory buffer.  Clear fdr field.
4159         (mips_elf_get_extr): Use pointer to unswapped external symbol.
4160         (mips_elf_final_link): Adjust for changes in bfd_ecoff functions.
4161         Preserve .text, .data and .bss even if they are empty.  Save
4162         pointer to unswapped external symbol rather than copying it.
4163         Don't free up the external symbols.
4164         * libelf.h (elf_symbol_type): Change mips_extr to PTR.
4165         * bfd-in.h (bfd_ecoff_debug_init, bfd_ecoff_debug_free): Declare.
4166         (bfd_ecoff_debug_accumulate): Update declaration.
4167         (bfd_ecoff_debug_accumulate_other): Rename declaration from
4168         bfd_ecoff_debug_link_other and update.
4169         (bfd_ecoff_write_accumulated_debug): Declare.
4170         * bfd-in2.h: Rebuilt.
4171         * Makefile.in: Rebuilt dependencies.
4172
4173 Mon Jan 10 20:46:53 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
4174
4175         * Makefile.in (install): Remove "@" which follows a backslash.  In
4176         this position it just causes errors, not suppresses echoes.
4177
4178 Mon Jan 10 09:06:21 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
4179
4180         * som.c (hppa_som_gen_reloc_type): Fix handling of LT and RT
4181         field selectors.
4182
4183 Sun Jan  9 04:32:25 1994  Ken Raeburn  (raeburn@kr-pc.cygnus.com)
4184
4185         * config/i386-netbsd.mt (SELECT_VECS): Include i386bsd_vec.
4186
4187 Fri Jan  7 10:27:27 1994  David J. Mackenzie  (djm@rtl.cygnus.com)
4188
4189         * aoutx.h (adjust_z_magic): Don't merge the start of bss with the
4190         end of data if they are not contiguous.
4191
4192         * aoutf1.h (sunos4_aout_backend): Comment the fields' meanings.
4193
4194 Fri Jan  7 15:40:16 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4195
4196         * ecoff.c (ecoff_mkobject_hook): Don't set SEC_SHARED_LIBRARY flag
4197         for .reginfo section here.
4198         (ecoff_new_section_hook): Set it here instead.
4199
4200 Fri Jan  7 10:29:27 1994  Stan Shebs  (shebs@andros.cygnus.com)
4201
4202         * bfd-in.h: (bfd_boolean): Add workaround for systems that also
4203         define true and false as enums.
4204         (ALMOST_STDC): Add as alternative to __STDC__.
4205         * bfd-in2.h: Rebuilt.
4206         * syms.c (bfd_print_symbol_vandf): Convert a PTR to FILE*.
4207
4208 Thu Jan  6 14:24:44 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4209
4210         * aoutx.h (translate_to_native_sym_flags): Catch the case where
4211         there is no output section.
4212
4213 Thu Jan  6 14:37:42 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4214
4215         * nlmcode.h (nlm_object_p): If we can't read the fixed header,
4216         count it as a wrong format error, not a system call error, since
4217         the object file might simply be too small.
4218
4219         * targets.c (target_vector): Added nlm32_alpha_vec inside #ifdef
4220         BFD64.
4221         * Makefile.in (BFD32_BACKENDS): Remove nlm32-alpha.o.
4222         (BFD64_BACKENDS): Add nlm32-alpha.o.  It depends on 64 bit
4223         support, even though it is for an Alpha in 32 bit mode.
4224         * configure.in (nlm32_alpha_vec): Set target64 to true.
4225
4226         * nlm32-gen.c, nlm64-gen.c: Removed.  All nlm targets are
4227         different, so there is no point to providing a generic one.
4228         * libnlm.h: Don't bother to check for nlm_backend(bfd) being NULL
4229         in the backend accessor macros; that should no longer be possible.
4230         * targets.c (target_vector): Removed nlm32_big_generic_vec,
4231         nlm64_big_generic_vec, nlm64_little_generic_vec.
4232         * configure.in (nlm32_big_generic_vec, nlm32_little_generic_vec,
4233         nlm64_big_generic_vec, nlm64_little_generic_vec): Removed.
4234         * Makefile.in: Rebuilt dependencies, and
4235         (BFD32_BACKENDS): Removed nlm32-gen.o.
4236         (BFD64_BACKENDS): Removed nlm64-gen.o.
4237         (CFILES): Removed nlm32-gen.c and nlm64-gen.c.
4238
4239         * hp300hpux.c (ARCH_SIZE): Define before including aoutx.h.
4240
4241         * linker.c (_bfd_generic_link_add_one_symbol): Add constructor and
4242         bitsize arguments.  Changed all callers (aoutx.h).
4243         * libbfd-in.h (_bfd_generic_link_add_one_symbol): Add constructor
4244         and bitsize arguments to declaration.
4245         * libbfd.h: Rebuilt.
4246
4247         * ecoff.c: First cut at new style of linker backend for
4248         ECOFF--added a bunch of functions.  Also:
4249         (ecoff_sec_to_styp_flags): Set flags for .pdata and .xdata.
4250         (ecoff_slurp_symbolic_header): New function.
4251         (ecoff_slurp_symbolic_info): Call ecoff_slurp_symbolic_header.
4252         (ecoff_compute_reloc_file_positions): New function.
4253         (ecoff_set_section_contents): Get out quickly if count is zero.
4254         Check errors better.
4255         (ecoff_write_object_contents): Put .xdata section in data segment.
4256         Call ecoff_compute_reloc_file_positions.  Don't output relocs or
4257         external symbols if outsymbols is NULL.
4258         (ecoff_bfd_final_link): Completely rewritten.
4259         * libecoff.h: Include bfdlink.h.
4260         (struct ecoff_backend_data): Add relocate_section field.
4261         (ecoff_data_type): Add sym_hashes and symndx_to_section fields.
4262         (struct ecoff_link_hash_entry): Define.
4263         (struct ecoff_link_hash_table): Define.
4264         (ecoff_bfd_link_add_symbols): Declare as function, not macro.
4265         (ecoff_bfd_link_hash_table_create): Likewise.
4266         * ecofflink.c (bfd_ecoff_debug_one_external): New function.
4267         (bfd_ecoff_debug_externals): Call bfd_ecoff_debug_one_external.
4268         * bfd-in.h (bfd_ecoff_debug_one_external): Declare.
4269         * bfd-in2.h: Rebuilt.
4270         * coff-alpha.c (alpha_howto_table): Mark BRADDR as
4271         partial_inplace, and set the src_mask to 0x1fffff.
4272         (alpha_ecoff_get_relocated_section_contents): Remove unused
4273         variable gp_warned.
4274         (alpha_convert_external_reloc): New static function.
4275         (alpha_relocate_section): New static function.
4276         (alpha_ecoff_backend_data): Initialize relocate_section field.
4277         * coff-mips.c (mips_relocate_refhi): New static function.
4278         (mips_relocate_section): New static function.
4279         (mips_ecoff_backend_data): Initialize relocate_section field.
4280
4281         * reloc.c (_bfd_relocate_contents): Corrected signed overflow
4282         checking when there is an addend.
4283
4284         * aoutx.h (NAME(aout,final_link)): Don't abort when trying to link
4285         a non a.out file, just pass it to _bfd_default_link_order.
4286         (aout_link_input_section_std): When doing a final PC relative link
4287         against a section symbol, subtract the VMA of the input section.
4288         (aout_link_input_section_ext): Likewise.
4289
4290         * linker.c (default_indirect_link_order): Renamed from
4291         _bfd_generic_indirect_link_order and made static.
4292         (_bfd_generic_final_link): Don't switch on link_order type, just
4293         call _bfd_default_link_order.
4294         (_bfd_default_link_order): Handle bfd_indirect_link_order type.
4295         * genlink.h: Removed declaration of
4296         _bfd_generic_indirect_link_order.
4297         * elf32-mips.c (mips_elf_final_link): Don't switch on link_order
4298         type, just call _bfd_default_link_order.
4299
4300 Tue Jan  4 21:23:37 1994  Ian Lance Taylor  (ian@cygnus.com)
4301
4302         * linker.c (generic_link_check_archive_element): Base the name of
4303         the created common section on the name of the section the symbol
4304         came from.
4305         (_bfd_generic_link_add_one_symbol): (case BIG): A common symbol
4306         must have a section, so don't bother to create one.
4307
4308 Mon Jan  3 15:32:16 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4309
4310         * aout-target.h (MY(vec)): Add DYNAMIC to mask of object flags.
4311         * aoutf1.h (NAME(aout,sunos4_write_object_contents)):
4312         If the DYNAMIC flag is set, set it in the exec header.
4313         * aoutx.h (NAME(aout,some_aout_object_p)): If the object is
4314         dynamically linked, set the DYNAMIC flag in the BFD.
4315         * libaout.h (N_SET_DYNAMIC): New macro.
4316         (N_DYNAMIC): Add missing 0 in mask.
4317
4318 Mon Jan  3 11:41:45 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4319
4320         * ecoff.c (ecoff_get_extr): Don't output section symbols as
4321         external symbols.
4322
4323         * bfd-in.h, hash.c: Change bfd_hash_allocate argument from size_t
4324         to unsigned int, because size_t may not be defined in bfd.h.
4325         * bfd-in2.h: Rebuilt.
4326
4327         * bfd-in.h (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
4328         be a const pointer.
4329         * bfd-in2.h: Rebuilt.
4330         * libbfd.c (bfd_get{b,l}[_signed_]{16,32,64}): Declare argument to
4331         be a const pointer.
4332         * targets.c (bfd_target): Change swap function pointers
4333         accordingly.
4334         * archive.c (do_slurp_coff_armap): Change swap accordingly.
4335         * aix386-core.c: Change NO_GET and NO_GETS accordingly.
4336         * hppabsd-core.c, hpux-core.c, irix-core.c, osf-core.c,
4337         ptrace-core.c, trad-core.c: Change NO_GET and NO_SIGNED_GET
4338         accordingly.
4339
4340         * libbfd-in.h (struct artdata): Added tdata field.
4341         (_bfd_add_bfd_to_archive_cache): Declare.
4342         (_bfd_get_elt_at_filepos): Declare.
4343         (_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr.
4344         * libbfd.h: Rebuilt.
4345         * archive.c: Cleaned up some more.
4346         (_bfd_generic_mkarchive, bfd_generic_archive_p): Initialize
4347         pointer elements of artdata.
4348         (_bfd_add_bfd_to_archive_cache): Renamed from add_bfd_to_cache.
4349         (_bfd_snarf_ar_hdr): Renamed from snarf_ar_hdr.
4350         (_bfd_get_elt_at_filepos): Renamed from get_elt_at_filepos.
4351         (get_extended_arelt_filename, bfd_construct_extended_name_table,
4352         bfd_ar_hdr_from_filesystem, compute_and_write_armap): Made static.
4353         * ecoff.c: Some comment changes.
4354         (ecoff_slurp_armap): Handle rename of snarf_ar_hdr.  Set
4355         ardata->tdata to raw_armap.
4356         (ecoff_archive_p): Initialize pointer elements of artdata.
4357         * coff-rs6000.c (rs6000coff_get_elt_at_filepos): Handle rename of
4358         add_bfd_to_cache.
4359
4360         * hash.c: Added some documentation.
4361
4362 Mon Jan  3 11:09:28 1994  Jim Kingdon  (kingdon@lioth.cygnus.com)
4363
4364         * aout-target.h, netbsd386.c: Replace NO_SWAP_MAGIC with SWAP_MAGIC,
4365         and do the swapping here rather than calling ntohl from the N_*
4366         macros.  This cleans up assumptions about the size of a host long,
4367         the existence to ntohl, etc.
4368
4369 Sat Jan  1 13:50:05 1994  Rob Savoye  (rob@darkstar.cygnus.com)
4370
4371         * config.bfd: Add support for VSTa micro-kernel. It currently uses
4372         i386-aout.
4373
4374 Sat Jan  1 10:18:54 1994  David J. Mackenzie  (djm@thepub.cygnus.com)
4375
4376         * hosts/i386mach3.h (HOST_SEGMENT_SIZE): Fix value.
4377         * i386mach3.c (SEGMENT_SIZE): Fix value.
4378
4379 Fri Dec 31 16:23:43 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4380
4381         Minor cleanups suggested by CodeCenter.
4382         * aoutx.h, coffgen.c, ecoff.c, ecofflink.c, elf.c, libbfd.c,
4383         linker.c, reloc.c, section.c, srec.c: Added /*ARGSUSED*/ as
4384         appropriate.
4385         * aoutx.h (struct external_exec): Removed unnecessary declaration.
4386         (NAME(aout,some_aout_object_p)): Set some tdata pointers to NULL.
4387         (adjust_z_magic): Removed useless variable data_vma.
4388         (stringtab_init): Initialize hash_zero.
4389         (add_to_stringtab): Removed unused fourth argument.
4390         (NAME(aout,swap_std_reloc_out)): Removed useless variable
4391         r_addend.
4392         (aout_link_input_section): Added some casts.
4393         * archive.c (get_extended_arelt_filename, do_slurp_coff_armap,
4394         bfd_ar_hdr_from_filesystem, bsd_write_armap, coff_write_armap):
4395         Minor code rewriting to make it more C like.
4396         (do_slurp_bsd_armap): Added some casts.
4397         * ecoff.c (ecoff_write_object_contents): Removed useless variable
4398         scn_base.
4399         (ecoff_write_armap): Added some casts.  Use "" rather than "\0".
4400         * ecofflink.c (bfd_ecoff_write_debug): Added a cast.
4401         * libaout.h (struct internal_exec): Removed unnecessary
4402         declaration.
4403         * linker.c (_bfd_generic_indirect_link_order): Added a cast.
4404         * opncls.c (new_bfd): Removed a cast.
4405         * reloc.c (bfd_generic_get_relocated_section_contents): Added
4406         some casts.
4407         * srec.c (internal_srec_write_object_contents): Removed useless
4408         variable bytes_written.
4409
4410 Fri Dec 31 11:46:13 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
4411
4412         * i386mach3.c (N_TXTADDR): Don't define after all.
4413         (TEXT_START_ADDR): Don't include exec header size in value.
4414
4415 Thu Dec 30 15:47:54 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
4416
4417         * i386mach3.c (N_TXTADDR): Define.
4418
4419 Thu Dec 30 13:37:24 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4420
4421         Extensive changes to move the bulk of the linker into BFD so that
4422         more efficient backend code can be written for specific object
4423         files.  Only existing efficient backend is a.out.
4424         * seclet.c, seclet.h: Removed.
4425         * hash.c, linker.c, genlink.h: New files.
4426         * bfd-in.h: Removed bfd_error_vector.  Declared hash table
4427         structures and functions.
4428         (JUMP_TABLE): Removed bfd_seclet_link, added
4429         bfd_link_hash_table_create, bfd_link_add_symbols and
4430         bfd_final_link.
4431         * All backends: Changed accordingly.
4432         * bfd-in2.h: Rebuilt.
4433         * bfd.c (struct _bfd): Added link_next and archive_pass fields.
4434         Removed ld_symbols field.
4435         (bfd_nonrepresentable_section, bfd_undefined_symbol,
4436         bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
4437         bfd_error_vector): Removed.
4438         (bfd_default_error_trap, bfd_error_trap,
4439         bfd_error_nonrepresentabltrap): Removed.
4440         (bfd_get_relocated_section_contents): Pass link_info.  Pass
4441         link_order instead of seclet.  Pass symbols.
4442         (bfd_relax_section): Pass link_info.
4443         (bfd_seclet_link): Removed.
4444         (bfd_link_hash_table_create, bfd_link_add_symbols,
4445         bfd_final_link): New macros.
4446         * libbfd-in.h: If __GNUC__ is defined and alloca is not, define
4447         alloca as __builtin_alloca.  Declare internal linking functions.
4448         * libbfd.h: Rebuilt.
4449         * libbfd.c (bfd_seek): Comment out fseek assertion.  It's worked
4450         for months.
4451         * reloc.c (reloc_howto_type): Added error_message argument to
4452         special_function field.  Changed all callers and all definitions.
4453         (bfd_get_reloc_size): Make argument a const pointer.
4454         (bfd_perform_relocation): Add error_message argument to hold
4455         string set if return value if bfd_reloc_dangerous.  Changed all
4456         callers.
4457         (_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
4458         * section.c (asection): Renamed seclets_head and seclets_tail to
4459         link_order_head and link_order_tail.
4460         * targets.c (bfd_target): Replaced seclet argument with link_info
4461         and link_order and symbols arguments in
4462         bfd_get_relocated_section_contents.  Added symbols argument to
4463         bfd_relax_section.  Removed bfd_seclet_link.  Added
4464         bfd_link_hash_table_create, bfd_link_add_symbols and
4465         bfd_final_link.
4466         * libaout.h (struct aoutdata): Added external_syms,
4467         external_sym_count, external_strings, sym_hashes fields.
4468         (obj_aout_external_syms, obj_aout_external_sym_count,
4469         obj_aout_external_strings, obj_aout_sym_hashes): New accessor
4470         macros.
4471         (WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
4472         * aoutx.h: Wrote new back end linker routines.
4473         (translate_to_native_sym_flags): Return boolean value.  Don't use
4474         bfd_error_vector.
4475         (NAME(aout,write_syms)): Return boolean value.  Check return value
4476         of translate_to_native_sym_flags and bfd_write.
4477         * aout-target.h (final_link_callback): New function.
4478         (MY_bfd_final_link): New function.
4479         * aout-adobe.c (aout_adobe_write_object_contents): Check return
4480         value of aout_32_write_syms.
4481         * hp300hpux.c (MY(write_object_contents)): Likewise.
4482         * i386lynx.c (WRITE_HEADERS): Likewise.
4483         * libaout.h (WRITE_HEADERS): Likewise.
4484         * bout.c: Changed functions to use link_info->callbacks rather
4485         than bfd_error_vector, and link_orders rather than seclets.
4486         * coff-alpha.c: Likewise.
4487         * coff-h8300.c: Likewise.
4488         * coff-h8500.c: Likewise.
4489         * coff-sh.c: Likewise.
4490         * coff-z8k.c: Likewise.
4491         * elf32-hppa.c: Likewise.
4492         * reloc16.c: Likewise.
4493         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
4494         up _gp in the hash table rather than in outsymbols.
4495         * coff-a29k.c (a29k_reloc): Pass errors back in new error_message
4496         argument rather than printing them.
4497         * coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
4498         link_order arguments rather than seclet.  Changed all uses and
4499         definitions.
4500         (bfd_coff_reloc16_estimate): Pass link_info arguments.  Changed
4501         all uses and definitions.
4502         * libcoff.h: Rebuilt.
4503         * ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
4504         not by ECOFF, make it scAbs.
4505         (ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
4506         rewritten.
4507         * elf32-mips.c (mips_elf_final_link): Renamed from
4508         mips_elf_seclet_link and rewritten.
4509         * elf32-hppa.c (elf32_hppa_stub_description): Added link_info
4510         field.
4511         (new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
4512         hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
4513         Added link_info arguments.  Changed all callers.
4514         * elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
4515         not NULL.
4516         * oasys.c (oasys_write_sections): Return boolean value rather than
4517         using bfd_error_vector.
4518         (oasys_write_object_contents): Check return value of
4519         oasys_write_sections.
4520         * hosts/std-host.h: Don't declare qsort or strtol.
4521         * Makefile.in: Rebuild dependencies.
4522         (BFD_LIBS): Removed seclet.o.  Added hash.o and linker.o.
4523         (CFILES): Removed seclet.c.  Added hash.c and linker.c.
4524         (HFILES): Removed seclet.h.  Added genlink.h.
4525
4526 Thu Dec 30 07:41:36 1993  Peter Schauer  (pes@regent.e-technik.tu-muenchen.de)
4527
4528         * section.c (bfd_get_section_contents):  Return zero filled buffer
4529         if section has no contents.
4530
4531 Tue Dec 28 12:43:54 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4532
4533         * elf.c (bfd_elf_generic_reloc): If this is not an inplace reloc,
4534         then skip bfd_perform_relocation even if the addend is non-zero.
4535
4536 Tue Dec 21 09:22:19 1993  Ken Raeburn  (raeburn@rtl.cygnus.com)
4537
4538         * coffcode.h (coff_write_relocs) [SWAP_OUT_RELOC_OFFSET]: Copy
4539         addend to r_offset field.
4540
4541         * Makefile.in (CFILES): Added coff-sparc.c.  Rebuild dependencies.
4542
4543         * coff-sparc.c (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET,
4544         CALC_ADDEND): Define.
4545
4546         * aix386-core.c (aix386_core_file_p): Use cd_regs[0] for computing
4547         the offsetof because AIX /bin/cc does not like to take the address
4548         of an array.  (From Minh Tran-Le.)
4549
4550 Thu Dec 16 13:06:32 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
4551
4552         * Thu Dec 16 15:41:06 1993  Peter Hoogenboom  (hoogen@cs.utah.edu)
4553
4554         * elf32-hppa.c (hppa_elf_build_arg_reloc_stub): Make sure to copy
4555         the return pointer into %r2 if no jump-in-call-delay-slot
4556         optimization was done.
4557
4558         * hosts/hp300bsd.h: Correctly identify 4.3BSD vs 4.4BSD.
4559
4560 Wed Dec 15 08:04:16 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
4561
4562         * hosts/std-host.h: (time): Don't declare; conflicts on Mach3.
4563
4564         * hosts/i386mach3.h (HOST_PAGE_SIZE): Set to 1 to avoid padding.
4565         (HOST_SEGMENT_SIZE): Set to 0 for same reason.
4566
4567         * i386mach3.c (PAGE_SIZE, SEGMENT_SIZE): Same changes as above.
4568         (TEXT_START_ADDR): Correct.
4569         (MY_backend_data): Define.
4570
4571         * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic):
4572         New functions; code moved from aout_<size>_adjust_sizes_and_vmas.
4573
4574 Tue Dec 14 21:48:33 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
4575
4576         * som.c (som_begin_writing): Fix thinkos in auxiliary header
4577         support.
4578         (bfd_som_attach_aux_hdr): Likewise.
4579
4580 Mon Dec 13 23:34:48 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
4581
4582         * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle 'T' field
4583         selectors for PIC code.
4584
4585         * som.c (hppa_som_gen_reloc_type): Handle 'T' field selectors.
4586         (som_write_fixups): Handle R_DLT_REL, R_FSEL, R_RSEL, R_LSEL
4587         relocations needed by PIC.
4588
4589 Tue Dec  7 15:47:51 1993  Stu Grossman  (grossman at cygnus.com)
4590
4591         * nlmcode.h:  Fixes to avoid compiler warnings...
4592
4593 Tue Dec  7 15:10:54 1993  Ian Lance Taylor  (ian@cygnus.com)
4594
4595         * libnlm.h (nlm_backend_data): Removed macro definition.
4596         (nlm_alpha_backend_data): Adjusted accordingly.
4597
4598 Sun Dec  5 19:32:08 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
4599
4600         * som.c (som_begin_writing): Flesh out code for handling simple
4601         auxiliary headers.
4602         (bfd_som_attach_aux_hdr): New function.
4603
4604         * som.h (struct somdata): Add fields for attaching version and
4605         copyright headers.  Add accessor macros.
4606
4607         * som.c (R_DLT_REL, R_AUX_UNWIND, R_SEC_STMT): Add protected
4608         definitions for old versions of HPUX which fail to define them.
4609         (som_hppa_howto_talbe): Add R_DLT_REL, R_AUX_UNWIND, and R_SEC_STMT
4610         now that they're safe.  Delete bogus R_STATEMENT relocations.
4611
4612         * som.c (som_hppa_howto_table): Add missing R_END_TRY.  Delete 
4613         extra R_DATA_OVERRIDE.
4614         (hppa_som_gen_reloc_type): Generate a relocation for the rounding
4615         mode selector if needed.
4616         (som_write_fixups): Handle requests for a change in the default
4617         rounding mode.  Rounding modes do not consume input bytes, but
4618         are just markers much like R_ENTRY and R_EXIT.
4619
4620 Sat Dec  4 19:40:32 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
4621
4622         Fri Dec  3 09:55:17 1993  Pete Hoogenboom  (hoogen@cs.utah.edu)
4623
4624         * elf32-hppa.c: (hppa_elf_reloc):  Do not do code reordering when
4625         the branch instruction as originally been nullified.
4626         hppa_elf_reloc):  Avoid useless call to bfd_put_32 () in the
4627         case of no code reordering due to an LDO instruction in the
4628         delay slot of the branch.  Make sure to relocate the correct
4629         instruction.  Do not perform instruction reordering for millicode
4630         calls.
4631         (hppa_elf_build_arg_reloc_stub):  Change the relocation type
4632         to R_HPPA_STUB_CALL_17 when special processing might be needed.
4633         (hppa_elf_build_long_branch_stub): Prevent code reordering on
4634         a call from a linker stub to another linker stub and for millicode
4635         calls.  Do not trash the return register for calls from one linker
4636         stub to a second linker stub.
4637
4638         * elf32-hppa.c: (elf_hppa_howto_table):  PLABEL and DLT
4639         relocations are not pc-relative.
4640
4641         * hppa_stubs.h: (BLE_N_XXX_0_31):  New instruction used in
4642         linker stub code. 
4643         (COPY_2_31):  Likewise.
4644
4645 Fri Dec  3 18:40:58 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4646
4647         * config/solaris2.mh (HDEFINES): Remove -Dconst=
4648         * hosts/solaris.h: If not __GNUC__, define const as empty.
4649
4650 Thu Dec  2 15:43:32 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4651
4652         * ecoff.c: Added various casts for 32/64 bit cross targeting.
4653         (ecoff_mkobject_hook): Set SEC_SHARED_LIBRARY for the .reginfo
4654         section so that the linker ignores it.
4655         * ecofflink.c: Added various casts for 32/64 bit cross targeting.
4656         (ecoff_add_bytes): Changed need argument to size_t.
4657         (bfd_ecoff_debug_link_other): Check return value of
4658         ecoff_add_string.
4659
4660         * libbfd-in.h (new_bfd): Use void rather than an empty parameter
4661         list.
4662         * libbfd.h: Rebuilt.
4663
4664         * libnlm.h (struct nlm_obj_tdata): New field backend_data.
4665         (nlm_backend_data, nlm_alpha_backend_data): New accessor macros.
4666         (struct nlm_backend_data): New field no_uninitialized_data.
4667         (nlm_no_uninitialized_data): New accessor macro.
4668         * nlmcode.h (nlm_compute_section_file_positions): Handle
4669         no_uninitialized_data.
4670         (nlm_external_reloc_compare): Sort relocs by address for a
4671         particular symbol, to make the sort more stable.
4672         (nlm_write_object_contents): Cast the arguments to qsort.  Get the
4673         value of a debugging symbol the same way we get the value of a
4674         normal symbol.
4675         * nlm32-alpha.c: Various changes.  Write out GP and .lita relocs.
4676         Set no_uninitialized_data to true.
4677         * nlm32-i386.c (nlm32_i386_backend), nlm32-sparc.c
4678         (nlm32_sparc_backend): Set no_uninitialized_data field false.
4679         * nlmswap.h (nlm_swap_fixed_header_out): Zero out destination
4680         before filling it in.
4681
4682 Wed Dec  1 21:47:58 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
4683
4684         * som.c (som_section_type, som_decode_symcalss): New functions.
4685         (som_get_symbol_info): Use them.
4686         (som_slurp_symbol_table): Set the section of common and undefined
4687         symbols correctly.
4688
4689 Wed Dec  1 14:15:10 1993  Ken Raeburn  (raeburn@cygnus.com)
4690
4691         * elfcode.h (write_relocs): Initialize local var LAST_SYM_IDX, to
4692         make gcc happy.
4693
4694         * mipsbsd.c: Changes from Ralph Campbell:
4695         (mips_howto_table_ext): MIPS_RELOC_LO16 should use
4696         complain_overflow_dont.
4697         (aout_mips_*_vec): Make name use "a.out" instead of "aout", to
4698         make gdb happy.
4699
4700         * bfd.c (bfd_errmsgs): Reword invalid-target message.
4701
4702         * config.bfd: For sparc*-*-coff, use sparc-coff.
4703         * configure.in: Handle sparccoff_vec.
4704         * targets.c (sparccoff_vec): Declare.
4705
4706         * reloc.c (bfd_get_reloc_size): New function.
4707         (struct reloc_howto_type): Update documentation of size field.
4708
4709 Wed Dec  1 14:39:05 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4710
4711         * nlm32-alpha.c: New file; preliminary Alpha NetWare support.
4712         * config.bfd (alpha-*-netware*): New target; use alpha-nlm.
4713         * config/alpha-nlm.mt: New file.
4714         * configure.in (nlm32_alpha_vec): New vector; use nlm32-alpha.o,
4715         nlm32.o, and nlm.o.
4716         * Makefile.in (BFD32_BACKENDS): Added nlm32-alpha.o.
4717         (CFILES): Added nlm32-alpha.c.
4718         Rebuilt dependencies.
4719         * targets.c (nlm32_alpha_vec): Declare.
4720
4721         * libnlm.h (struct nlm_backend_data): New fields
4722         optional_prefix_size, nlm_backend_object_p, nlm_write_prefix,
4723         nlm_set_public_section, nlm_get_public_offset.  Removed unused
4724         nlm_write_reloc field.  Changed nlm_write_import to remove
4725         unnecessary symbol argument.  Renamed nlm_write_externals to
4726         nlm_write_external, and changed cound argument from bfd_vma to
4727         bfd_size_type.
4728         (nlm_optional_prefix_size, nlm_backend_object_p_func,
4729         nlm_write_prefix_func, nlm_set_public_section_func,
4730         nlm_get_public_offset_func): New accessor macros.
4731         (nlm_write_reloc_func): Removed.
4732         (nlm_write_external_func): Adjusted for field renaming.
4733         * nlm32-i386.c (nlm_i386_write_import): Renamed from
4734         nlm_i386_write_reloc.  Removed old nlm_i386_write_import which
4735         just called old nlm_i386_write_reloc.
4736         (nlm_i386_write_external): Renamed from nlm_i386_write_externals.
4737         Declared.  Changed second argument from bfd_vma to bfd_size_type.
4738         (nlm32_i386_backend): Adjusted for changes to fields and names.
4739         * nlm32-sparc.c (nlm_sparc_mangle_relocs): Removed unused,
4740         ifdeffed out code.
4741         (nlm_sparc_write_import): Removed second argument.
4742         (nlm_sparc_write_external): Renamed from
4743         nlm_sparc_write_externals.  Changed second argument from bfd_vma
4744         to bfd_size_type.
4745         (nlm32_sparc_backend): Adjusted for changes to fields and names.
4746         * nlmcode.h: Removed some unused code.
4747         (nlm_object_p): Don't destroy tdata pointer.  Call
4748         backend_object_p function if it exists.
4749         (nlm_slurp_symbol_table): Removed unused variable rcount.  Call
4750         set_public_section_func if it exists instead of checking
4751         NLM_HIBIT.
4752         (nlm_compute_section_file_positions): Account for
4753         optional_prefix_size.
4754         (nlm_write_object_contents): Account for optional_prefix_size.
4755         Removed useless variable write_reloc_func.  Changed declaration
4756         and call of write_import_func.  Call write_prefix_func if it
4757         exists.  Removed unused variables len and temp.  Call
4758         get_public_offset_func if it exists rather than setting NLM_HIBIT.
4759         * nlmswap.h: Declare functions.
4760
4761         * bfd-in.h (uint64_typeLOW, uint64_typeHIGH): Fully parenthesize
4762         for clarity.
4763         (fprintf_vma, sprintf_vma): Use %lx, not %x.
4764         * bfd-in2.h: Rebuilt.
4765         * hosts/alphaosf.h (uint64_typeLOW, uint64_typeHIGH): Cast results
4766         to unsigned long.
4767
4768         * config.bfd: Don't set target64 here, as the setting is ignored.
4769         * configure.in (ecoffalpha_little_vec): Set target64.
4770
4771         * config/alphaosf.mt (TDEFINES): Removed; setting host parameters
4772         in TDEFINES is wrong.
4773
4774         * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
4775         Remove unused variable output_section.
4776
4777 Tue Nov 30 16:45:23 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4778
4779         * irix-core.c: New file for Irix 4 and Irix 5 core support.
4780         Functions taken out of coff-mips.c.  Handle vmap type VMAPFILE.
4781         * coff-mips.c: Irix 4 core file support moved to irix-core.c.
4782         * targets.c: If IRIX_CORE defined, include irix_core_vec in
4783         target_vector.
4784         * config/irix4.mh (HDEFINES): Add -DIRIX_CORE.
4785         (HDEPFILES): Define to be irix-core.o.
4786         * config/irix5.mh (HDEFINES): Define to be -DIRIX_CORE.
4787         (HDEPFILES): Define to be irix-core.o.
4788         * Makefile.in (OPTIONAL_BACKENDS): Added irix-core.o.  Removed
4789         sco-core.o, which no longer exists.
4790         (CFILES): Added all *-core.c files.
4791         Rebuilt dependencies.
4792
4793 Wed Nov 24 02:02:41 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4794
4795         * elfcode.h (map_program_segments): Restore check of file_size !=
4796         mem_size, but only if SHT_PROGBITS.
4797
4798         * ecofflink.c: New file to hold ECOFF debug information linking
4799         routines.
4800         * ecoff.c (ecoff_clear_output_flags, ecoff_rel, ecoff_dump_seclet,
4801         ecoff_add_string, ecoff_get_debug): Removed.  Functionality now in
4802         ecofflink.c.
4803         (ecoff_get_extr, ecoff_set_index): New functions.
4804         (ecoff_slurp_symbolic_info): Don't save raw_size.
4805         (ecoff_bfd_seclet_link): Rewrote to use ecofflink.c functions.
4806         (ecoff_compute_section_file_positions): Don't set EXEC_P just
4807         because there is a start address.
4808         (ecoff_write_object_contents): Handle external symbols here.  Use
4809         ecofflink.c functions to write out debugging information.
4810         * elf32-mips.c (mips_elf_read_ecoff_info, mips_elf_get_extr,
4811         mips_elf_set_index): New functions.
4812         (mips_elf_seclet_link): Discard empty sections, the .options
4813         section and .gptab sections.  Handle linking .mdebug section.
4814         * libecoff.h (ecoff_data_type): Removed raw_size and ifdbase.
4815         * libelf.h (elf_symbol_type): Added mips_extr to tc_data union.
4816         * bfd-in.h: Added prototypes for routines in ecofflink.c (some are
4817         called by gas, so they are public).
4818         * bfd-in2.h: Rebuilt.
4819         * Makefile.in (BFD_LIBS): Added ecofflink.o.
4820         (CFILES): Added ecofflink.c.
4821         (ecofflink.o): New target.  Rebuilt dependencies.
4822
4823 Mon Nov 22 22:26:42 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
4824
4825         * som.c (hppa_object_p): Also recognize SHARED_MAGIC_CNX as
4826         a valid magic number if it's been defined.
4827
4828 Mon Nov 22 14:17:36 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4829
4830         * ecoff.c (ecoff_mkobject): Don't create .scommon section; linker
4831         no longer requires it.
4832         (ecoff_bfd_seclet_link, ecoff_sizeof_headers,
4833         ecoff_write_object_contents): Don't treat .scommon section
4834         specially.
4835
4836 Mon Nov 22 10:54:27 1993  Fred Fish  (fnf@cygnus.com)
4837
4838         Merged changes from kev@spuds.geg.mot.com (Kevin A. Buettner):
4839         * bfd/config/delta88.mh (HDEFINES): Define this to be -DPTRACE_CORE.
4840         * bfd/config/delta88.mh (HDEPFILES): Defined to be ptrace-core.o.
4841         * bfd/ptrace-core.c:  New file for dealing with core files with
4842         start with the ptrace_user structure found on BCS compliant systems.
4843         * bfd/targets.c (ptrace_core_vec):  New vector.
4844
4845 Mon Nov 22 02:33:12 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
4846
4847         * Minimal support for reading SOM fixup streams.  Allows
4848         objdump -r to do something reasonable.
4849         * som.c (som_get_reloc_upper_bound): Implement.
4850         (som_canonicalize_reloc): Implement.
4851         (som_set_reloc_info, som_slurp_reloc_table): New functions.
4852
4853 Sun Nov 21 13:46:55 1993  Ken Raeburn  (raeburn@cambridge.cygnus.com)
4854
4855         * hosts/lynx.h (FPRINTF_ALREADY_DECLARED): Define.
4856         * hosts/sparclynx.h: Include lynx.h instead of duplicating it.
4857
4858 Fri Nov 19 14:34:04 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4859
4860         * coff-a29k.c (a29k_reloc): For R_IREL, don't left shift
4861         signed_value before sign extending it.  Don't subtract out
4862         reloc_entry->address.  This makes it compatible with what gas is
4863         generating.
4864
4865         * elfcode.h (elf_fake_sections): Accept .sbss as the name for a
4866         SHT_NOBITS sections.
4867         (map_program_segments): Don't leave the loop after the first
4868         SHT_NOBITS section.
4869         (assign_file_positions_except_relocs): Only force sh_offset and
4870         sh_addr to match modulo maxpagesize for a section which is not
4871         SHT_NOBITS.  Changed the method used to force page alignment after
4872         a SHT_NOBITS section to only do it for the last such consecutive
4873         section, and to really force page alignment.
4874
4875 Fri Nov 19 04:02:01 1993  Ken Raeburn  (raeburn@cambridge.cygnus.com)
4876
4877         * coffcode.h (coff_slurp_symbol_table): Print more verbose message
4878         in the case of an unknown (or unhandled) storage class.
4879
4880         * config/i386-lynx.mt (TDEFINES): FPRINTF_ALREADY_DECLARED should
4881         not be defined here, since it is a host attribute, not a target
4882         one.
4883         * config/m68k-lynx.mt, config/sparc-lynx.mt: Ditto.
4884
4885         * coffcode.h (coff_bfd_reloc_type_lookup): Don't define if already
4886         defined.
4887
4888         * coff-sparc.c: Define some relocations, based on ELF relocations.
4889         (enum reloc_type, bfd_coff_generic_reloc, coff_sparc_howto_table,
4890         struct coff_reloc_map, sparc_reloc_map,
4891         coff_sparc_reloc_type_lookup): Borrowed from elf32-sparc.c and
4892         elf.c, renamed.
4893         (coff_bfd_reloc_type_lookup): Define to be coff_sparc_reloc_....
4894         (rtype2howto): Index into coff_sparc_howto_table using
4895         dst->r_type.
4896
4897 Thu Nov 18 11:45:39 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4898
4899         * config.bfd (mips*-*-irix5*): New target; use mipsbelf.
4900         * configure.host (mips-sgi-irix5*) New host; use irix5 (no
4901         hosts/irix5.h created; just use std-host.h).
4902         * config/irix5.mh: New file; like irix4.mh, but don't use -G or
4903         -lmalloc.
4904         * Makefile.in: Rebuilt dependencies.
4905
4906         * ecoffswap.h: Changed type of internal pointers for swap out
4907         functions to const *.
4908
4909         * elf32-mips.c (mips_elf_got16_reloc): New function.  Handle GOT16
4910         correctly for assembler, but linker support not implemented.
4911         (elf_mips_howto_table): Use mips_elf_got16_reloc for GOT16.
4912         (mips_elf_sym_is_global): New function; at least on Irix 5, all
4913         non section symbols are considered global.
4914         (elf_backend_sym_is_global): Define.
4915         (mips_elf_final_write_processing): New function.  Set the MIPS
4916         architecture level correctly.
4917         (elf_backend_final_write_processing): Define.
4918         (mips_elf_section_from_shdr): Handle SHT_MIPS_OPTIONS.
4919         (mips_elf_fake_sections): Set entsize of .mdebug or .reginfo
4920         section to 1.  Handle .options section.
4921         (mips_elf_acom_section, mips_elf_acom_symbol,
4922         mips_elf_acom_symbol_ptr): New static variables, used to build a
4923         generic .acommon section to hold SHN_MIPS_ACOMMON symbols.
4924         (mips_elf_symbol_processing): Handle SHN_MIPS_ACOMMON symbols by
4925         putting them all in a global .acommon section.
4926
4927         * elfcode.h (bfd_section_from_shdr): Don't dump core if target
4928         section has no ELF section data.
4929         (elf_make_sections): Set addralign of reloc section to 4.
4930         (elf_fake_sections): Likewise.
4931         (map_program_segments): Don't consider section 0.
4932         (assign_file_positions_except_relocs): Don't consider section 0.
4933         In the main loop, skip the symtab and strtab sections, since their
4934         positions are set elsewhere.
4935         (swap_out_syms): Set addralign of symtab section to 4.  Set
4936         addralign of strtab sections to 1.
4937         (assign_file_positions_for_relocs): Don't consider section 0.
4938         (write_object_contents): Don't write out section 0.
4939
4940         * libelf.h (struct elf_backend_data): Added fields
4941         elf_backend_sym_is_global and elf_backend_final_write_processing.
4942         * elf32-target.h (elf32_bed): Added corresponding initializers.
4943         * elf64-target.h (elf64_bed): Likewise.
4944         * elfcode.h (sym_is_global): Take abfd argument.  Call
4945         elf_backend_sym_is_global if it is not NULL.
4946         (elf_map_symbols): Pass abfd to sym_is_global.
4947         (write_object_contents): Call elf_backend_final_write_processing
4948         if it is defined.
4949
4950 Wed Nov 17 18:43:28 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
4951
4952         * libecoff.h: Include coff/ecoff.h.
4953         (struct ecoff_backend_data): Move external debugging information
4954         fields into a single field pointing to an ecoff_debug_swap
4955         structure.
4956         (ecoff_data_type): Move debugging information fields into a single
4957         field pointing to an ecoff_debug_info structure.
4958         * coff-alpha.c, coff-mips.c, ecoff.c: Corresponding changes.
4959
4960 Wed Nov 17 17:38:58 1993  Sean Eric Fagan  (sef@cygnus.com)
4961
4962         * nlmswap.h: New file to swap fixed header.  Included by NLM
4963         backends.
4964         * libnlm.h (struct reloc_and_sec): Define.
4965         (struct nlm_backend_data): Add fields fixed_header_size,
4966         nlm_read_import, nlm_write_import, nlm_swap_fhdr_in,
4967         nlm_swap_fhdr_out.
4968         (nlm_fixed_header_size, nlm_read_import_func,
4969         nlm_write_import_func, nlm_swap_fixed_header_in_func,
4970         nlm_swap_fixed_header_out_func, nlm_write_external_func): New
4971         accessor macros.
4972         * nlmcode.h: Use new functions.
4973         * nlm32-i386.c: Provide new functions.
4974         * nlm32-sparc.c: New file; SPARC NLM backend.
4975
4976 Wed Nov 17 13:56:10 1993  Stan Shebs  (shebs@rtl.cygnus.com)
4977
4978         * i386lynx.c (swap_std_reloc_in, swap_ext_reloc_in): Ignore
4979         garbage bits appearing in the upper end of symbolnums.
4980
4981         * config/sparc-lynx.mt (TDEFINES): Add -DFPRINTF_ALREADY_DECLARED.
4982
4983 Tue Nov 16 17:03:41 1993  Stu Grossman  (grossman at cygnus.com)
4984
4985         * lynx-core.c (lynx_core_file_p):  Change bfd_zalloc to bfd_alloc.
4986         * m68klynx.c:  Define core file macros.
4987         * hosts/i386lynx.h, hosts/m68klynx.h, hosts/lynx.h:  Move all
4988         non-architecture specific stuff into lynx.h.
4989
4990 Tue Nov 16 15:45:54 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
4991
4992         * i386linux.c: Define new macro ZMAGIC_DISK_BLOCK_SIZE to 1024, and
4993         change PAGE_SIZE to 4096.
4994
4995 Mon Nov 15 11:48:08 1993  Ken Raeburn  (raeburn@rtl.cygnus.com)
4996
4997         * Makefile.in (diststuff): New target.
4998
4999         * VERSION: Updated.
5000
5001 Sun Nov 14 23:33:01 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5002
5003         * som.c (som_object_setup): Do not create dummy ".text", ".data",
5004         and ".bss" sections.
5005         (setup_sections): Do not set SEC_HAS_CONTENTS if a section's size
5006         is zero.  Recognize BSS type sections and turn off SEC_LOAD and
5007         SEC_DATA (so binutils/size works).  Set the correct value for
5008         a section's _raw_size.
5009         (som_slurp_symbol_table): Program entry points, and millicode are
5010         also functions.  Mark them as such.  Also mark L$* symbols as
5011         debugging symbols.
5012
5013         * bfd-in2.h: Rebuilt.
5014
5015 Sat Nov 13 15:27:15 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5016
5017         * som.c (som_bfd_reloc_type_lookup): Add missing prototype.  Returns
5018         a pointer to constant data.  Delete bogus #define which made the 
5019         function useless.
5020
5021         * som.c (som_prep_for_fixups): New function.
5022         (som_write_fixups): New function.
5023         (som_write_space_strings): New function.
5024         (som_write_symbol_strings): New function.
5025         (som_begin_writing): New function.
5026
5027 Fri Nov 12 15:29:36 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5028
5029         * som.c (som_write_object_contents): Do not abort.  Flesh out.
5030         (som_set_section_contents): Do not abort.  Flesh out.
5031
5032         * som.c (som_write_headers): New function.
5033         (som_prep_headers): New function.
5034         (som_build_and_write_symbol_table): New function.
5035
5036         * som.c (som_sizeof_headers): Add missing prototype.
5037         (som_set_arch_mach): Do not abort.
5038
5039         * som.c (som_count_spaces): New function.
5040         (som_count_subspaces): New function.
5041         (compare_syms): New function.
5042         (som_compute_checksum): New function.
5043
5044         * som.c (hppa_som_gen_reloc_type): New function.
5045         (som_bfd_reloc_type_lookup): New function.
5046
5047         * som.c (try_prev_fixup): New function.
5048         (som_reloc_skip): New function.
5049         (som_reloc_addend): New function.
5050         (som_reloc_call): New function.
5051
5052         * som.c (som_initialize_reloc_queue): New function.
5053         (som_reloc_queue_insert): Likewise.
5054         (som_reloc_queue_fix): Likewise.
5055         (som_reloc_queue_find): Likewise.
5056
5057         * som.c (som_hppa_howto_table): SOM howto relocation table.
5058         (hppa_som_reloc): New function.
5059
5060         * som.c (struct reloc_queue): New structure to keep track of
5061         the last four multibyte relocations emitted.
5062         (enum pa_symbol_type): Type to fully describe the symbol types
5063         associated with .import/.export assembler directives.
5064
5065         * som.c: Include libhppa.h
5066
5067         * som.c (bfd_som_set_section_attributes): New function.
5068         (bfd_som_set_subsection_attributes): Likewise.
5069         (bfd_som_set_symboL_type): Likewise.
5070         (bfd_som_attach_unwind_info): Likewise.
5071         * som.h: Declare new exported functions.
5072
5073         * som.h (struct som_symbol): Add new fields to hold additional
5074         information needed to build/write symbol tables and fixup streams.
5075         (struct som_section_data_struct): Add new fields to hold additional
5076         information needed to build/write space and subspace headers.
5077         (som_symbol_data): New accessor macro for SOM symbol information.
5078         (R_HPPA_*): Basic relocation types to be used by the assembler.
5079
5080 Fri Nov 12 11:00:28 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
5081
5082         * trad-core.c (trad_unix_core_file_p): If new hook
5083         TRAD_CORE_ALLOW_ANY_EXTRA_SIZE defined, then skip the check for the
5084         corefile being too big.
5085         * hosts/i386sco.h: Define it.
5086
5087 Thu Nov 11 15:16:28 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5088
5089         * bfd.c (struct _bfd): Add hppabsd_core_data.
5090         * targets.c (target_vector): Add hppabsd_core_vec.
5091         * hpux-core.c (hpux_core_core_file_p): Fail if an unknown core
5092         section is encountered during core section scanning.
5093         * hppabsd-core.c: New file.
5094         * config/hppabsd.mh: Enable HPPA BSD core files.
5095
5096         * elf32-hppa.c (hppa_elf_reloc): Remove DEFUN crud.  Remove code
5097         which is either commented out or ifdef'd out.  Add, update and
5098         clean comments.  Fix various indention and spacing problems.  Handle
5099         problems related to using "ble" to jump to a stub rather than "bl"
5100         (%r31 is trashed by "ble", but not by "bl").
5101         (NEW_INSTRUCTION): Put inside curly braces.
5102         (CURRENT_STUB_OFFSET): Fix indention problems.
5103         (hppa_elf_build_arg_reloc_stub): Fix indention and spacing problems.
5104         Add, update and clean comments.  Handle "ble" %r31 lossage problems.
5105         (hppa_elf_build_long_branch_stub): Likewise.
5106         (hppa_look_for_stubs_in_section): Likewise.
5107         (hppa_elf_stub_check): Remove obsolete function.
5108
5109         * hppa_stubs.h: Add new instructions to deal with %r31 lossage
5110         problems.  Delete unused instructions.
5111         
5112 Tue Nov  9 11:40:27 1993  Stan Shebs  (shebs@rtl.cygnus.com)
5113
5114         * m68klynx.c (TARGET_IS_BIG_ENDIAN_P): Define.
5115
5116 Tue Nov  9 11:26:05 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5117
5118         * elfcode.h (elf_object_p): Rather than looking through an array
5119         of architectures, get the ELF EM_xxx code from the backend
5120         information.  Let the generic ELF target match any EM_xxx code not
5121         matched by another ELF target.  Call elf_backend_object_p to let
5122         the backend do more checks and set global information.
5123         * libelf.h (struct elf_backend_data): Added elf_machine_code and
5124         elf_backend_object_p fields.
5125         (struct bfd_elf_arch_map): Removed.
5126         (bfd_elf_arch_map, bfd_elf_arch_map_size): Don't declare.
5127         * elf32-target.h, elf64-target.h: Initialize elf_machine_code
5128         field with ELF_MACHINE_CODE.  Initialize elf_backend_object_p
5129         field with elf_backend_object_p (if it is defined).
5130         * elf32-gen.c, elf32-hppa.c, elf32-i386.c, elf32-i860.c,
5131         elf32-m68k.c, elf32-m88k.c, elf32-mips.c, elf32-sparc.c,
5132         elf64-gen.c (ELF_MACHINE_CODE): Defined.
5133         * elf32-mips.c: Include ecoffswap.h to get ECOFF swapping
5134         routines.
5135         (mips_elf_object_p): Set the right machine number.
5136         (mips_elf_ecoff_debug_swap): Defined.
5137         (elf_backend_object_p): Defined to be mips_elf_object_p.
5138         (elf_backend_ecoff_debug_swap): Defined to be
5139         mips_elf_ecoff_debug_swap.
5140         * elf.c (bfd_elf_arch_map, bfd_elf_arch_map_size): Removed.
5141
5142         * libbfd-in.h (target_vector, default_vector): Declare.
5143         * libbfd.h: Rebuilt.
5144         * format.c (target_vector, default_vector): Don't declare.
5145
5146         * elf32-mips.c (elf_mips_howto_table): Don't complain on overflow
5147         for R_MIPS_26.  Correct overflow detection requires matching the
5148         upper four bits of the destination against the PC.  From Ted Lemon
5149         <mellon@pepper.ncd.com>.
5150
5151         * bout.c (b_out_reloc_type_lookup): Return type should point to
5152         const data.
5153         * coff-i960.c (coff_i960_reloc_type_lookup): Likewise.
5154         * elf32-hppa.c (elf_hppa_reloc_type_lookup): Likewise.
5155         * mipsbsd.c (MY(reloc_howto_type_lookup)): Likewise.
5156         * coff-i386.c (coff_i386_reloc): Made howto const.
5157         * oasys.c (oasys_write_data): Made how const.
5158
5159         * libelf.h: Added some comments.
5160         (struct elf_backend_data): Added elf_backend_ecoff_debug_swap
5161         field.  Removed unused write_relocs field.
5162         * elf32-target.h: Adjusted elf_backend_data initialization
5163         accordingly.
5164         * elf64-target.h: Corrected elf_backend_data initialization to
5165         fill in all fields and to set elf_64_p to 1.
5166
5167 Mon Nov  8 18:13:14 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5168
5169         * elfcode.h (bfd_section_from_shdr): Remove duplicate assignment
5170         to filepos in SHT_STRTAB case.
5171         (assign_file_position_for_section): Set BFD section filepos as
5172         well as ELF section sh_offset.
5173
5174         * reloc.c: Use const instead of CONST.
5175         (bfd_perform_relocation): Make variable howto a const pointer.
5176         * bfd-in2.h, libbfd.h: Rebuilt.
5177
5178 Mon Nov  8 12:19:15 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
5179
5180         * Makefile.in (realclean): Don't remove generated headers.  Reverts
5181         change of 2 Jul 1993.
5182
5183 Mon Nov  8 06:08:31 1993  D. V. Henkel-Wallace  (gumby@cirdan.cygnus.com)
5184
5185         * configure.bfd: make unixware equivalent to sysv4.
5186
5187         * config/i386-nlm.mt: bring in elf config; make it the default.
5188
5189 Sun Nov  7 20:21:38 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5190
5191         * libbfd.c (bfd_put_8): Add parens around reference to "val"
5192         argument.
5193
5194 Fri Nov  5 21:45:09 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
5195
5196         * hosts/i386mach3.h (HOST_SEGMENT_SIZE),
5197         i386mach3.c (SEGMENT_SIZE, TEXT_START_ADDR): Correct values (?).
5198
5199 Fri Nov  5 15:17:57 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5200
5201         * coffcode.h (coff_write_object_contents): Zero out internal_a.
5202
5203 Fri Nov  5 10:41:07 1993  David J. Mackenzie  (djm@thepub.cygnus.com)
5204
5205         * aoutx.h, archive.c, archures.c, bfd.c, cache.c, coffcode.h,
5206         core.c, ctor.c, format.c, init.c, libbfd.c, opncls.c, reloc.c,
5207         section.c, syms.c, targets.c:
5208         Doc cleanup (spelling, punctuation, grammar, formatting).
5209         * bfd-in2.h, libbfd.h: Rebuild.
5210
5211 Thu Nov  4 14:46:14 1993  John Gilmore  (gnu@rtl.cygnus.com)
5212
5213         * bfd-in.h (bfd_get_cacheable, bfd_set_cacheable):  New accessors.
5214         * bfd.c, opncls.c:  Improve comments on file descriptor cacheing.
5215
5216 Thu Nov  4 08:54:30 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
5217
5218         * From Pete Hoogenboom (hoogen@cs.utah.edu)
5219         * elf32-hppa.c (hppa_elf_get_section_contents): Fix logic error
5220         in last change.  Always rebuild symbol extension section the first
5221         time though if output sections exist (fixes ld -r problems).
5222
5223 Thu Nov 04 08:08:46 1993  Jeffrey Wheat  (cassidy@cygnus.com)
5224
5225         * Makefile.in: Add .PHONY for check and installcheck rules.
5226
5227 Tue Nov  2 14:42:27 1993  Bill Cox (bill@tarkas.cygnus.com)
5228
5229         * libbfd-in.h (artdata): Use long, not time_t for portability, at
5230           least to HPUX.  File below is a derived file.
5231
5232 Tue Nov  2 14:42:27 1993  Bill Cox (bill@tarkas.cygnus.com)
5233
5234         * libbfd.h (artdata): Use long, not time_t for portability, at
5235           least to HPUX.
5236
5237 Tue Nov  2 09:32:25 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
5238
5239         * config.bfd: Use bigmips for mips*-*-bsd*.
5240
5241 Mon Nov  1 14:30:09 1993  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
5242
5243         * elfcode.h (elf_slurp_reloca_table, elf_slurp_reloc_table):
5244         Handle symbol number of zero.
5245
5246         * reloc.c (enum bfd_reloc_code_real): Added
5247         BFD_RELOC_MIPS_LITERAL, BFD_RELOC_MIPS_GOT16,
5248         BFD_RELOC_MIPS_CALL16, BFD_RELOC_MIPS_GPREL32.
5249         * bfd-in2.h: Rebuilt.
5250         * coff-mips.c (mips_bfd_reloc_type_lookup): Handle
5251         BFD_RELOC_MIPS_LITERAL.
5252         * elf32-mips.c (mips_reloc_map): Handle new relocs.
5253         (mips_elf_hi16_reloc, mips_elf_lo16_reloc): Rearrange _gp_disp
5254         checks slightly.
5255
5256         * aout-target.h (MY_bfd_debug_info_start, MY_bfd_debug_info_end,
5257         MY_bfd_debug_info_accumulat [sic]): Remove unused definitions.
5258         (MY_bfd_get_relocated_section_contents, MY_bfd_relax_section,
5259         MY_bfd_seclet_link): Define.
5260         (MY_bfd_reloc_type_lookup): Rename from
5261         MY_reloc_howto_type_lookup.
5262         (MY_bfd_make_debug_symbol): Rename from MY_make_debug_symbol.
5263         (MY(vec)): Use JUMP_TABLE rather than listing functions.
5264         * hp300hpux.c (MY_get_symtab, MY_get_symtab_upper_bound,
5265         MY_canonicalize_reloc, MY_write_object_contents): Don't define in
5266         terms of MY, because that causes a recusive invocation of CAT when
5267         expanded within JUMP_TABLE, and ANSI compilers don't expand
5268         recursive macros.
5269         * mipsbsd.c (MY_bfd_reloc_type_lookup): Rename from
5270         MY_reloc_howto_type_lookup, and don't define in terms of MY.
5271         (MY_canonicalize_reloc): Don't define in terms of MY.
5272         (aout_mips_little_vec, aout_mips_big_vec): Use JUMP_TABLE rather
5273         than listing functions.
5274
5275 Mon Nov  1 09:12:25 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
5276
5277         * config.bfd: Use m68k-elf for m68*-*-sysv4*.
5278
5279 See file ChangeLog.1
5280
5281 \f
5282 Local Variables:
5283 mode: indented-text
5284 left-margin: 8
5285 fill-column: 74
5286 version-control: never
5287 End: