Commit Graph

3287 Commits

Author SHA1 Message Date
Ian Lance Taylor 148437ec14 * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Add
filter_shlib and auxiliary_filter_shlib parameters.
	* elf.c (_bfd_elf_print_private_bfd_data): Handle DT_AUXILIARY and
	DT_FILTER.
	* bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration.
	(bfd_elf64_size_dynamic_sections): Likewise.
	* bfd-in2.h: Rebuild.
1996-12-31 19:46:37 +00:00
Ian Lance Taylor 1eeccb2271 * xcofflink.c (xcoff_build_ldsyms): When exporting all defined
symbols, don't export a symbol which is defined by an object in an
	archive which contains shared objects.
PR 11379.
1996-12-30 23:50:56 +00:00
Fred Fish fc46a9ec7a * archures.c (enum bfd_architecture): Add bfd_arch_tic80
for TI TMS320c80 (MVP).
	(bfd_archures_list): Add bfd_tic80_arch.
	* bfd-in2.h: Regenerate by running "make headers".
1996-12-30 23:25:26 +00:00
Fred Fish 60b2671252 * cpu-tic80.c (bfd_tic80_arch): Add struct.
* configure.in (case $vec): Correct typo, "tb" not "tp".
	Also add cofflink.o for tic80coff_vec.
	* configure: Regenerate with autoconf.
1996-12-30 22:09:39 +00:00
Ian Lance Taylor 412f8c9336 * libbfd.c: Patch up the mmap code so that it is only built if BFD
is configured with --with-mmap.
1996-12-30 16:56:05 +00:00
Fred Fish 5a608f5bf1 * Makefile.in (BFD32_BACKENDS): Add coff-tic80.o
(ALL_MACHINES): Add cpu-tic80.o
	(cpu-tic80.o, coff-tic80.o): Add dependencies.
	* coff-tic80.c: Add skeleton, cloned from another coff config.
	* coffcode.h (coff_write_object_contents): Set magic to TIC80MAGIC
 	for TIc80.
1996-12-29 17:56:24 +00:00
Fred Fish 2a0a42d300 Add TIc80 stuff keep/lose stuff. 1996-12-28 04:16:24 +00:00
Fred Fish cd6213ffae (Lay some groundwork for TIc80 port that will be filled in incrementally.)
* TODO: Correct a misspelling.
start-sanitize-tic80
	* coff-tic80.c: New file for TI TMS320C80 (MVP).
	* cpu-tic80.c: New file for TI TMS320C80 (MVP).
	* configure.in (case $vec): Add tic80coff_vec entry.
	* configure: Regenerate with autoconf.
	* archures.c (bfd_tic80_arch): Declare.
	* bfd-in2.h (enum bfd_architecture): Add bfd_arch_tic80.
	* config.bfd (case ${targ}): Add tic80*-*-coff* target.
	* targets.c (tic80coff_vec): Add decl as extern bfd_target.
	(bfd_target_vector): Add tic80coff_vec entry.
end-sanitize-tic80
1996-12-28 04:09:34 +00:00
Ian Lance Taylor 2503987b96 fix typoo in comment 1996-12-27 17:24:12 +00:00
Ian Lance Taylor 6b8ec6f321 * elflink.h (elf_buckets): Add some more values for larger
binaries.
1996-12-27 16:51:27 +00:00
Ian Lance Taylor 78650abdef * Makefile.in (install): Move subdir_do out of conditional. From
Fred Fish <fnf@cygnus.com>.
1996-12-26 23:37:43 +00:00
Jeff Law 8d16fe5cdb * elf32-mn10200.c (enum reloc_type): Enable basic 8, 16, and
32 bit relocs.
        (elf_mn10200_howto_table): Likewise.
        (mn10200_reloc_map): Likewise.
To keep the assembler quiet.
1996-12-18 17:09:59 +00:00
Ian Lance Taylor e4f4813f9c * elf32-mips.c (mips_elf_add_symbol_hook): Add 1 to the value of a
mips16 symbol during the link.
	(mips_elf_finish_dynamic_symbol): Subtract 1 from the value of a
	mips16 symbol.
	(mips_elf_link_output_symbol_hook): New static function.
	(elf_backend_link_output_symbol_hook): Define.
1996-12-17 18:58:59 +00:00
Ian Lance Taylor 69e2ff181d * elf.c (bfd_elf_print_symbol): Print the st_other field if it is
not zero.
1996-12-17 16:12:58 +00:00
Ian Lance Taylor e85f2fbd15 * elf.c (bfd_section_from_shdr): Don't check for reloc sections
against SEC_DEBUGGING sections here (revert patch of December 5).
	* elfcode.h (elf_object_p): Check for them here, instead.
1996-12-16 19:39:39 +00:00
Ian Lance Taylor e35765a9a2 * elfcode.h (elf_slurp_reloc_table): Add dynamic parameter.
* elf.c (_bfd_elf_canonicalize_reloc): Pass new argument to
	slurp_reloc_table.
	(_bfd_elf_get_dynamic_reloc_upper_bound): New function.
	(_bfd_elf_canonicalize_dynamic_reloc): New function.
	* elf-bfd.h (struct elf_size_info): Update declaration of
	slurp_reloc_table.
	(_bfd_elf_get_dynamic_reloc_upper_bound): Declare.
	(_bfd_elf_canonicalize_dynamic_reloc): Declare.
	* elfxx-target.h: Use new dynamic reloc routines by default.
	* elf64-mips.c (mips_elf64_slurp_reloc_table): Add dynamic
	parameter.
1996-12-15 19:59:18 +00:00
David Edelsohn 21e45f8225 * libaout.h (enum machine_type): Change M_SPARCLET from 142 to 131.
At the request of matra.
1996-12-13 19:17:46 +00:00
Ian Lance Taylor 6270adfb59 Fri Dec 13 13:18:49 1996 Dan Wilder <dan@gasboy.com>
* coffcode.h (coff_set_flags): Use MC68KBCSMAGIC for bfd_arch_m68k
	if NAMES_HAVE_UNDERSCORE is defined.
1996-12-13 18:21:03 +00:00
Ian Lance Taylor 440f391466 * elflink.h (elf_link_add_object_symbols): Only add a weak
symbol if the real definition is in the dynamic symbol table.
	After finding the real definition, then, if it is dynamic, add the
	weak symbol to the dynamic symbol table.
PR 11244.
1996-12-13 02:29:37 +00:00
Ian Lance Taylor e5c3708d54 * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Make static.
PR 11253.
1996-12-12 20:27:49 +00:00
Michael Meissner e7bab9df0f Support R_PPC_PLTREL24 1996-12-12 20:08:54 +00:00
Ian Lance Taylor a5147005bb * ppcboot.c (ppcboot_set_arch_mach): Don't define; it's a
function.
	(ppcboot_bfd_print_private_bfd_data): Don't take the address of an
	array.
PR 11256.
1996-12-12 19:57:22 +00:00
Jeff Law e14af8fc41 * elf32-mn10300.c (reloc_type): Remove big endian mn10300 reloc
variants.
        (elf32_mn10300_howto_table, mn10300_reloc_map): Likewise.
        (bfd_elf32_mn10300_reloc): Write data in little endian format.
        * reloc.c: Remove mn10300 big endian relocs.
        * bfd-in2.h, libbfd.h: Rebuilt.

        * elf32-mn10200.c: Update from elf32-mn10300.c.
1996-12-11 06:31:23 +00:00
Jeff Law 31cffd2ee6 * elf32-mn10300.c (elf_symbol_leading_char): Define. 1996-12-06 22:51:44 +00:00
Jeff Law 207e944c81 * elf32-mn10300.c: Add some comments.
Still cleaning up.
1996-12-06 22:23:37 +00:00
Ian Lance Taylor 6dcf1ef5de * ihex.c (ihex_scan): Always initialize buf before jumping to
error_return.
	(ihex_read_section): Likewise.
1996-12-06 22:20:24 +00:00
Jeff Law d28f058e54 * elf32-mn10300.c (elf_mn10300_howto_table): Don't set partial-
inplace for most relocs.
1996-12-06 05:35:00 +00:00
Ian Lance Taylor 80be821d2e * elflink.h (elf_link_add_object_symbols): Calling check_relocs
even if SEC_ALLOC is not set.
	* elf32-i386.c (elf_i386_check_relocs): Don't check SEC_ALLOC
	when deciding whether to copy a reloc into a shared object.
	(elf_i386_relocate_section): Likewise.
	* elf32-sparc.c (elf32_sparc_check_relocs): Likewise.
	(elf32_sparc_relocate_section): Likewise.
	* elf32-i386.c (elf_i386_check_relocs): Don't set SEC_ALLOC in a
	reloc section if it is not set in the source section.
	* elf32-sparc.c (elf32_sparc_check_relocs): Likewise.
	* elf.c (bfd_section_from_shdr): Mark a reloc section associated
	with a SEC_DEBUGGING section as SEC_DEBUGGING.
PR 11174.
1996-12-05 18:47:03 +00:00
Michael Meissner e5c4495c9e #if 0 some code that is not used yet 1996-12-04 19:19:15 +00:00
Ian Lance Taylor 5dda64611e * cofflink.c (_bfd_coff_generic_relocate_section): Print an error
message for bfd_reloc_outofrange, rather than aborting.  From
	Philippe De Muyter <phdm@info.ucl.ac.be>.
1996-12-02 18:18:33 +00:00
Ian Lance Taylor 179b58d949 * cofflink.c (_bfd_coff_final_link): If there aren't any relocs in
a relocateable link, don't try to process them.  From Heinz Wrobel
	<wrobel@lpr.e-technik.tu-muenchen.de>.
1996-12-02 17:15:05 +00:00
Jeff Law 943686fa04 * elf32-mn10300.c (mn10300_info_howto): Renamed from
mn10300-Info_howto_rel.  Tweak reloc argument to be an
        Elf32_Internal_Rela.
        (USE_RELA): Define instead of USE_REL.
        (elf_info_to_howto, elf_info_howto_rel): Corresponding changes.
1996-12-02 07:44:50 +00:00
Peter Schauer 0e0f410619 * configure.in, configure: Handle mips*-sgi-irix6*.
* irix-core.c (irix_core_core_file_p):  Accept CORE_MAGICN32
	core files.
1996-12-01 08:31:05 +00:00
Ian Lance Taylor 15aafe49cc * elf32-i386.c (elf_i386_relocate_section): Warn about a
relocation against a symbol defined in a section with no output
	section.
PR 11174.
1996-11-27 17:11:05 +00:00
Ian Lance Taylor dfc7020d17 * aclocal.m4 (BFD_CC_FOR_BUILD): Don't require AC_C_CROSS.
* configure, config.in: Rebuild with autoconf 2.12.
1996-11-26 21:53:58 +00:00
Ian Lance Taylor 6c02f1a02c * elf-bfd.h (struct elf_link_hash_entry): Add other field.
* elf.c (_bfd_elf_link_hash_newfunc): Initialize other field.
	(swap_out_syms): Set st_other from existing st_other field.
	* elflink.h (elf_link_add_object_symbols): Store st_other in hash
	table other field.
	(elf_link_output_extsym): Set the other field from the global hash
	table entry.
	* elf32-mips.c (enum reloc_type): Add R_MIPS16_26.
	(elf_mips16_jump_howto): New static variable.
	(mips16_jump_reloc): New static function.
	(bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS16_JMP.
	(mips_info_to_howto_rel): Handle R_MIPS16_26.
	(mips_elf_relocate_section): Handle R_MIPS16_26.  Handle R_MIPS_26
	to a mips16 symbol.
	* reloc.c (BFD_RELOC_MIPS16_JMP): Add to list of relocs.
	* bfd-in2.h, libbfd.h: Rebuild.
	* cpu-mips.c (arch_info_struct): Add mips:16 entry.
1996-11-26 16:43:03 +00:00
Ian Lance Taylor f082b5eaea * configure.host: Use long long for mips-sgi-irix6*. 1996-11-26 02:38:33 +00:00
Jeff Law 12fdaaf821 * elf32-mn10300.c (bfd_elf32_mn10300_reloc): New function.
(enum reloc_type): Add more reloc types.
        (elf32_mn10300_howto_table): Update for new reloc types.
        (elf32_mn10300_reloc_map): Update for new reloc types.
        * reloc.c: Add some new relocs for the mn10300 series.
        * bfd-in2.h, libbfd.h: Rebuilt.
Last week's reloc work.
1996-11-25 15:59:07 +00:00
Jeff Law 23def2765b * som.c (setup_sections): Don't lose for a space which has
no data, but some symbols.
binutils/11140
1996-11-23 20:30:54 +00:00
Ian Lance Taylor a600a89e4f * sunos.c (struct sunos_link_hash_table): Add got_needed field.
(sunos_link_hash_table_create): Initialize got_needed.
	(sunos_create_dynamic_sections): Only set .got section size if it
	is not already set.  Set got_needed.
	(bfd_sunos_size_dynamic_sections): Check got_needed.  Only set
	sdynptr, and only handle dynamic sections, if dynamic sections are
	needed.
	(sunos_scan_std_relocs): Pass false to create_dynamic_sections.
	Initialize .got section.
	(sunos_scan_ext_relocs): Likewise.
	(sunos_write_dynamic_symbol): Set up PLT entry even if this is not
	a dynamic symbol.
	(sunos_finish_dynamic_link): Check got_needed.  Only set up
	dynamic linking information if needed.
PR 11074.
1996-11-22 16:39:17 +00:00
Rob Savoye aa09d6b2fb * config.bfd: Added VersaDOS format to the Ericsson configuration. 1996-11-21 19:04:56 +00:00
Jeff Law c3239e6693 * elf32-mn10300.c: Rough cut at relocs for the mn10300. 1996-11-20 23:31:13 +00:00
Dawn Perchik cf13e3fc30 * filemode.c: Include sysdep.h.
* ihex.c: Add casts to eliminate compiler warnings.
    * sunos.c: Add casts to eliminate compiler warnings.
1996-11-12 23:28:49 +00:00
Michael Meissner 9e23db7616 Add more support for V.4 shared libs 1996-11-11 15:40:04 +00:00
David Edelsohn affcfcf9af * elf32-m32r.c (elf_m32r_howto_table, R_M32R_24): Use
complain_overflow_unsigned.
1996-10-29 23:09:51 +00:00
Ian Lance Taylor c0e8bfc01c add missing end-sanitize-v850 1996-10-29 22:04:56 +00:00
Martin Hunt 421a2956fe Tue Oct 29 12:53:46 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* elf32-d10v.c (elf_d10v_howto_table): Don't complain on
	overflows for R_D10V_16 and R_D10V_18.
1996-10-29 20:55:52 +00:00
Ian Lance Taylor 061cc10b03 * ieee.c (ieee_write_section_part): Use LMA rather than VMA.
(do_with_relocs): Likewise.
	(do_as_repeat): Likewise.
	(copy_expression): Likewise.
PR 10946.
1996-10-29 18:26:11 +00:00
Stu Grossman 27c7e9077d * aclocal.m4, configure: Set USE_BINARY_FOPEN for *-*-windows. 1996-10-24 16:10:11 +00:00
Jeff Law 90ffe48b18 * elf32-v850.c: Add comments about assumptions about
char, short & long sizes.
        (elf32_v850_bfd_final_link_relocate): Fix sign extension
        problems for several relocs.
Still fixing sda/tda/zda stuff.
1996-10-23 21:10:55 +00:00
Ian Lance Taylor 84be2a8fa2 * xcofflink.c (bfd_xcoff_import_symbol): Don't allocate ldsym.
Store import file index in ldindx.
	(xcoff_build_ldsyms): Assume that ldsym was not previously
	allocated.  For an imported symbol, copy ldindx into l_ifile.
1996-10-23 04:22:34 +00:00
Jeff Law c322f1b523 * elf32-v850.c (elf_v850_howto_table): Fix ordering of
R_V850_ZDAOFFSET and R_V850_TDAOFFSET.  Fix various
        fields in R_V850_TDAOFFSET.
        (elf32_v850_bfd_final_link_relocate): Tweak pc-relative
        relocs to work more like other relocs.  Handle R_V850_TDAOFF
        relocations.
v850 tda, sda & zda stuff.
1996-10-23 04:10:41 +00:00
Jeff Law 725b96f599 * elf32-v850.c: Include bfdlink.h.
(bfd_elf32_v850_reloc): Return an error if we get a reloc
        we can't handle.
        (elf32_v850_bfd_final_link_relocate): New function.
        (v850_elf_relocation_section): Likewise.
        (elf_backend_relocate_section): Define.
New-style linker for the v850 (necessary to handle zda, sda & tda).
sda & tda relocs seem to be working.  No tda reloc support yet.
1996-10-23 01:24:24 +00:00
Ian Lance Taylor 40c0ea5ad6 * binary.c (binary_set_section_contents): Ignore sections which
don't have SEC_LOAD and SEC_ALLOC set.
PR 10914.
1996-10-22 21:23:50 +00:00
Ian Lance Taylor 68553b6361 * elf32-mips.c (elf_mips_howto_table): Describe R_MIPS_64.
(mips32_64bit_reloc): New static function.
	(mips_reloc_map): Add entry for BFD_RELOC_64.
	(mips_elf_relocate_section): Handle R_MIPS_64.
1996-10-21 23:56:13 +00:00
Jeff Law 9c52f4b2f7 * linker.c (_bfd_generic_final_link): Avoid losing static
symbols in the .bss section.
Something Stu noticed.
1996-10-21 18:15:24 +00:00
Ian Lance Taylor bd4dd3d011 * linker.c (default_indirect_link_order): Print an error message
when attempting to do a relocateable link with different object
	file formats, rather than calling abort.
1996-10-21 14:56:17 +00:00
David Edelsohn 5691054491 * reloc.c (m32r relocs): Rename them.
* bfd-in2.h, libbfd.h: Regenerated.
	* elf32-m32r.c: Update.
	(m32r_elf_10_pcrel_reloc): New function.
	(elf_m32r_howto_table, R_M32R_10_PCREL entry): Use it.
	(elf_m32r_howto_table, R_M32R_24 entry): Fix {src,dst}_masks.
1996-10-17 17:46:53 +00:00
Jeff Law b6d08fce22 * elf32-v850.c (enum reloc_type): Add R_V850_SDA_OFFSET,
R_V850_TDA_OFFSET and R_V850_ZDA_OFFSET.
        (elf_v850_howto_table): Corresponding changes.
        (elf_v850_reloc_map): Corresponding changes.
        * reloc.c: Add additional V850 relocations.
        * bfd-in2.h, libbfd.h: Rebuilt.
1996-10-17 04:45:29 +00:00
Jeff Law 4948949ea2 * linker.c (_bfd_generic_final_link): Set "linker_mark" for
all sections that will be included in the output file.
        (_bfd_generic_link_output_symbols): Discard symbols in sections
        which are being discarded.
Fixes 4 failures in the g++ testsuite on the v850.
1996-10-16 20:27:18 +00:00
Jeff Law e1d98a0a65 * elf32-v850.c (bfd_elf32_v850_reloc): Mask out bits we
no longer want in pc-relative relocs.
Fixing some g++ testsuite failures.
1996-10-16 17:26:50 +00:00
Jeff Law 05f1baaa20 * elf32-v850.c (bfd_elf32_v850_reloc): Don't silently
accept a reloc against an undefined sybmol!
jeez.  I'm going to go sit in the corner and hide.
1996-10-16 04:18:51 +00:00
Stu Grossman 1336da39bd * elf32-v850.c: Define elf_symbol_leading_char to be '_'. 1996-10-15 23:19:29 +00:00
Ian Lance Taylor ede836b9aa * VERSION: Bump for new relocation. 1996-10-15 20:58:52 +00:00
Ian Lance Taylor c24453fece * hosts/i386bsd.h: If NBPG is not defined, define it as
PAGE_SIZE, for recent versions of FreeBSD.
1996-10-15 16:41:38 +00:00
Ian Lance Taylor e7a5045867 * configure.host: Use `long long' as the 64 bit type on a Solaris
host, since both gcc and the SunPRO compilers support it.
1996-10-14 16:38:13 +00:00
Ian Lance Taylor 6b31fd3af3 Mon Oct 14 11:17:24 1996 Richard Henderson <rth@tamu.edu>
* reloc.c: Create a new BFD_RELOC_ALPHA_ELF_LITERAL.  It was a
	mistake to have reused the ECOFF LITERAL for ELF since they have
	different semantics.
	* elf64-alpha.c (elf_reloc_map): Map from ELF_LITERAL.
	* bfd-in2.h, libbfd.h: Rebuild.

	* elf64-alpha.c (elf64_alpha_size_dynamic_sections): Trap .got
	section overflow.

	* elf64-alpha.c (elf64_alpha_relocate_section): Do not emit a
	dynamic relocation for an undefweak symbol when we are building
	a static executable.
1996-10-14 15:21:54 +00:00
Stan Shebs f20f247499 * mpw-make.sed (config.bfd, targmatch.sed): Edit references to
point explicitly to srcdir.
	(targmatch.h): Edit references to point explicitly to objdir.
1996-10-10 18:21:37 +00:00
Ian Lance Taylor 3e222a5a5b * config.bfd: When setting targ_cpu, don't get confused by
linux-gnu.
1996-10-10 18:15:23 +00:00
Ian Lance Taylor 1c4794f58f * elflink.h (elf_link_add_object_symbols): If a symbol is a weak
definition in a dynamic object, add it to the dynamic symbol table
	if any dynamic object mentions it.  Reverts part of last patch.
PR 10827.
1996-10-08 18:50:59 +00:00
Ian Lance Taylor 9d81de1984 * sunos.c (struct sunos_link_hash_table): Add got_base field.
(sunos_link_hash_table_create): Initialize got_base.
	(bfd_sunos_size_dynamic_sections): If the .got section is more
	than 0x1000 bytes, set __GLOBAL_OFFSET_TABLE_ and got_base to
	0x1000.
	(sunos_check_dynamic_reloc): Subtract got_base from a base
	relative relocation.
PR 10684.
1996-10-08 16:02:35 +00:00
Stu Grossman 8150179797 * configure.host: Add support for windows host (a build done
under the Microsoft build environment).
1996-10-08 15:54:19 +00:00
Ian Lance Taylor fe4ff51570 * elf32-mips.c (elf_mips_isa): New static function.
(_bfd_mips_elf_merge_private_bfd_data): Don't warn about linking
	-mips1 and -mips2 code together, or -mips3 and -mips4 code.
1996-10-08 15:41:08 +00:00
Ian Lance Taylor 1233f74bc4 * archive.c (do_slurp_coff_armap): Only treat archive as little
endian for i960 COFF.
1996-10-07 15:45:44 +00:00
Ian Lance Taylor 65f56a5863 * coffcode.h (coff_compute_section_file_positions): Adjust sofar
by the change in size of the section when EXEC_P is not set.
1996-10-04 22:52:58 +00:00
Ian Lance Taylor a9dd34a919 * coff-m68k.c (coff_rtype_to_howto): Define if not defined.
(m68kcoff_rtype_to_howto): New static function.
	* cf-m68klynx.c (coff_m68k_lynx_rtype_to_howto): Add the section
	VMA to the addend for a PC relative reloc.
1996-10-04 22:40:55 +00:00
Ian Lance Taylor 05a68c24cb * dep-in.sed: Rework backslash loop a bit to avoid bug in sed on
HP/UX 10.20.
	* Makefile.in: Rebuild dependencies.
1996-10-04 20:24:34 +00:00
Ian Lance Taylor a3d5a7062d * dep-in.sed: Remove ../bfd/sysdep.h, since it will appear when
som.h is included.
1996-10-04 17:50:47 +00:00
Jeff Law c00ae065d4 * Makefile.in: Remove explicit dependencies for mn10200 and
mn10300 files.
        (ALL_MACHINE_CFILES): Add cpu-mn10200.c and cpu-mn10300.c.
        (BFD32_BACKENDS_CFILES): Add elf32-mn10200.c and elf32-mn10300.c
        (dependencies): Rebuilt.
1996-10-04 17:44:55 +00:00
Ian Lance Taylor 1d871eb78f * cofflink.c (coff_link_add_symbols): Set obj_coff_keep_syms
during this function.
1996-10-03 23:17:36 +00:00
Ian Lance Taylor 6b5af55cea * elflink.c (_bfd_elf_create_linker_section): Only use an existing
section if the flags are compatible.
1996-10-03 22:48:20 +00:00
Ian Lance Taylor dee9979493 * configure.in: Add havevecs, and put it in tdefaults.
* mpw-config.in: Likewise.
	* configure: Rebuild.
	* targmatch.sed: New file; a sed script to build targmatch.h from
	config.bfd.
	* config.bfd: Add #if, #endif, and comments for targmatch.h.
	* targets.c: Include "fnmatch.h".
	(struct targmatch): Define.
	(bfd_target_match): Define by including targmatch.h.
	(bfd_find_target): If the target is not found by name, search for
	it as a configuration triplet.
	* Makefile.in: Rebuild dependencies.
 	(BFD32_BACKENDS): Add aout-arm.o, aout-sparcle.o, hp300bsd.o,
	i386dynix.o, m68k4knetbsd.o, and riscix.o.
	(BFD32_BACKENDS_CFILES): Add aout-arm.c, aout-sparcle.c,
	hp300bsd.c, i386dynix.c, m68k4knetbsd.c, and riscix.c.
	(HFILES): Add targmatch.h.  Also, alphabetize and reindent.
	(CFILES): Remove i386dynix.c and hp300bsd.c.
	(targmatch.h): New target.
	(do_clean): Remove targmatch.h.

	* configure.in: Add BFD_NEED_DECLARATION(getenv).
	* acconfig.h: Add NEED_DECLARATION_GETENV.
	* configure, config.in: Rebuild.
	* sysdep.h: If NEED_DECLARATION_GETENV, declare getenv.
	* aout-adobe.c (aout_adobe_object_p): Don't declare getenv.
1996-10-03 21:36:08 +00:00
Jeff Law ae1b99e42d Grrr. The mn10200 and mn10300 are _not_ similar enough to easily support
with a single generic configuration.  So break them up into two different
configurations.  See the individual ChangeLogs for additional detail.
1996-10-03 16:42:22 +00:00
Jason Molenda 4c7f3fdef5 * Makefile.in (do_clean): Move config.log to do_distclean. 1996-10-03 06:37:32 +00:00
Jeff Law efc2b06463 * cpu-mn10x00.c, elf32-mn10x00.c: New files.
* Makefile.in (ALL_MACHINES): Add cpu-mn10x00.o.
        (BFD32_BACKENDS): Similarly for elf32-mn10x00.o.
        (elf32-mn10x00.o): Add dependencies.
        * archures.c (enum bfd_architecture): Add bfd_arch_mn10x00.
        (bfd_mn10x00_arch): Declare.
        (bfd_archures_list): Add bfd_mn10x00_arch.
        * config.bfd: Add mn10x00-*-*.
        * configure.in: Add bfd_elf32_mn10x00_vec.
        * elf.c (prep_headers): Handle bfd_arch_mn10x00.
        * targets.c (bfd_elf32_mn10x00_vec): Declare.
        (bfd_target_vector): Add bfd_elf32_mn10x00_vec.
        * bfd-in2.h, configure: Rebuilt.
Stubbing out Matsushita support.
1996-10-03 03:56:20 +00:00
Ian Lance Taylor a0fe6c2dc6 * freebsd.h (N_GET_MAGIC_NET): Don't use ntohl.
(N_GETMID_NET, N_GETFLAG_NET): Likewise.
	(NO_SWAP_MAGIC): Don't define.
	(SWAP_MAGIC): Define.
1996-10-02 20:41:36 +00:00
Ian Lance Taylor bf53bd9faa Wed Oct 2 15:46:45 1996 Klaus Kaempf <kkaempf@progis.de>
openVMS/Alpha: Provide filename and case_hack flags via
	symbol table from gas.
	Add case_hack code for symbol output from vax/vms.
	* evax-alpha.c (evax_initialize): Remove filename handling,
	filename is provided via symbol table.
	(evax_get_symtab): Use local symbol count when setting up table.
	* evax-egsd.c (_bfd_evax_slurp_egsd): Print correct name when
	debugging.
	(_bfd_evax_write_egsd): Skip file name symbol.
	* evax-emh.c (get_vms_time_string): Local function now.
	(_bfd_evax_write_emh): Extract source filename and case_hack flags
	from symbol table.
	* evax_write_etir (_bfd_evax_write_etir): Pass all symbol names
	through _bfd_evax_case_hack_symbol.
	* evax-misc.c (hash_string, _bfd_evax_case_hack_symbol): New
	functions.
	(_bfd_evax_basename): Removed.
	(_bfd_get_vms_time_string): Moved to evax-emh.c.
	* evax.h (evax_private_data_struct): Remove filename.
	(flag_hash_long_names, flag_show_after_trunc,
	flag_no_hash_mixed_case, vms_name_mapping): New flags for
	vms_case_hack.
1996-10-02 19:49:01 +00:00
Ian Lance Taylor 263d4a626b * cofflink.c (_bfd_coff_link_input_bfd): Don't crash if there is
no hash table entry for a global symbol.
1996-10-02 16:02:56 +00:00
Ian Lance Taylor 8dd53b5cc8 * cofflink.c (coff_link_add_symbols): Don't override a meaningful
symbol type with T_NULL.  Warn if symbol type changes.  Based on
	patch from Philippe De Muyter <phdm@labauto1.ulb.ac.be>.
1996-10-01 21:57:47 +00:00
Ian Lance Taylor 161ac690ee Tue Oct 1 16:14:22 1996 Joel Sherrill <joel@oarcorp.com>
* config.bfd (mips*-*-rtems*): New target, like mips*-*-elf*.
1996-10-01 20:15:48 +00:00
Ian Lance Taylor 0db6249c77 * elflink.h (elf_link_add_object_symbols): Only put a symbol from
a dynamic object in the dynamic symbol table if it is referenced
	or defined by a regular object.
PR 10711.
1996-10-01 16:33:01 +00:00
David Edelsohn 80675684b7 * reloc.c: Rename m32r relocs.
* bfd-in2.h, libbfd.h: Rebuilt.
	* elf32-m32r.c: Update.
1996-09-23 16:24:46 +00:00
Ian Lance Taylor e12ab364d2 * aoutx.h (aout_link_input_section_ext): When doing a relocateable
link, adjust the symbol index of a base relative reloc.  Don't
	change the addend of a PC relative reloc if pcrel_offset is set.
	* sunos.c (bfd_sunos_size_dynamic_sections): Don't do anything for
	a relocateable link.
PR 10692.
1996-09-20 16:33:44 +00:00
Ian Lance Taylor a5a43df165 * reloc.c (bfd_perform_relocation): Apply the relocation even if
it is zero, in case src_mask matters.
	(bfd_install_relocation): Likewise.
PR 10685.
1996-09-20 15:44:49 +00:00
Ian Lance Taylor e425358ff1 * xcofflink.c (xcoff_link_add_symbols): Always initialize
keep_syms.
 	(_bfd_xcoff_bfd_final_link): Don't set target_index
	to an uninitialized value.
1996-09-19 15:08:58 +00:00
Ian Lance Taylor 8d784abe56 * coff-sh.c (sh_relocate_section): Check for an illegal symbol
index.
1996-09-17 20:10:59 +00:00
Ian Lance Taylor 7f21c97c44 * coffcode.h (coff_slurp_line_table): Warn about illegal symbol
indices, rather than crashing.
	(coff_slurp_reloc_table): Likewise.  Check whether the howto field
	is NULL.
1996-09-17 18:20:06 +00:00
Ian Lance Taylor 1153e84b7b * coff-arm.c (aoutarm_std_reloc_howto): Change dst_mask for ARM26D
reloc to 0.
	(coff_arm_adjust_symndx): New static function.
	(coff_adjust_symndx): Define.
Fix ld -r.
1996-09-16 22:31:16 +00:00
Ian Lance Taylor 9859bc3192 * srec.c (srec_scan): Accept multiple symbols on a single line.
From Pascal Martin <pmartin@alsys.com>.
1996-09-16 17:05:12 +00:00
Ian Lance Taylor b876014567 * README: New file. 1996-09-16 16:40:13 +00:00
David Edelsohn f8b82e49d2 * aoutf1.h (MY_bfd_merge_private_bfd_data): Define.
(sunos_merge_private_bfd_data): New function.
1996-09-13 22:18:58 +00:00
Ian Lance Taylor 76d30c3f49 * bfd.c (bfd_copy_private_bfd_data): Switch on output BFD rather
than input BFD.
	(bfd_merge_private_bfd_data): Likewise.
	* section.c (bfd_copy_private_section_data): Likewise.
	* syms.c (bfd_copy_private_symbol_data): Likewise.
	* bfd-in2.h: Rebuild.
	* aout-target.h (MY_bfd_copy_private_section_data): Check that
	both BFD's are the right flavour.
	* ecoff.c (_bfd_ecoff_bfd_copy_private_bfd_data): Likewise.
	* elf.c (_bfd_elf_copy_private_symbol_data): Likewise.
	* elf32-mips.c (_bfd_mips_elf_copy_private_bfd_data): Likewise.
	(_bfd_mips_elf_merge_private_bfd_data): Likewise.
	* elf32-ppc.c (ppc_elf_copy_private_bfd_data): Likewise.
	(ppc_elf_merge_private_bfd_data): Likewise.
	* elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Likewise.
	* peicode.h (pe_bfd_copy_private_section_data): Likewise.
1996-09-13 21:01:43 +00:00
Ian Lance Taylor 0a7b87358f * elf32-hppa.c (elf_hppa_howto_table): Fill in some fields for
R_PARISC_DIR32, so that _bfd_stab_section_find_nearest_line passes
	its sanity check.
1996-09-13 19:52:14 +00:00
David Edelsohn 6cb9c90330 * cpu-m32r.c,elf32-m32r.c: New files. 1996-09-12 18:58:36 +00:00
David Edelsohn 3ebefb0701 * reloc.c: Add m32r relocs.
* bfd-in2.h, libbfd.h: Rebuilt.
1996-09-12 18:56:14 +00:00
Ian Lance Taylor cacfb845c8 * ieee.c (ieee_vec): Set symbol_leading_char field to '_'. 1996-09-12 15:15:06 +00:00
Ian Lance Taylor e461da9b65 * tekhex.c (first_phase): Change type parameter from char to int.
(out): Likewise.
	(pass_over): Change func to expect int, not char.
1996-09-11 21:08:33 +00:00
Ian Lance Taylor d7775b4355 * elf.c (assign_file_positions_for_segments): Test SEC_ALLOC
rather than SEC_LOAD when aligning the file offset for the first
	section in a segment.
Fixes the case in which . is set just before the .bss section in a
linker script.
1996-09-11 15:59:34 +00:00
Fred Fish ea3f058549 * syms.c (coff_section_type): Make arg const.
* irix-core.c (irix_core_core_file_p): Remove extraneous extra arg
	to make_bfd_asection().
	* elf-bfd.h (bfd_section_from_phdr): Add prototype.
	* elfcode.h (bfd_section_from_phdr): Remove prototype.
	(_bfd_elf_stringtab_init): Remove prototype.

	* netbsd-core.c (swap_abort): Add prototype.
	* aix386-core.c (swap_abort): Ditto & make static
	* hpux-core.c (swap_abort): Ditto & make static.
	* irix-core.c (swap_abort): Ditto & make static.
	* ptrace-core.c (swap_abort): Ditto & make static.
	* trad-core.c (swap_abort): Ditto & make static.
	* coffswap.h (coff_swap_reloc_in): Ditto.
	(coff_swap_reloc_out): Ditto.
	(coff_swap_filehdr_in): Ditto.
	(coff_swap_filehdr_out): Ditto.
	(coff_swap_sym_in): Ditto.
	(coff_swap_sym_out): Ditto.
	(coff_swap_aux_in): Ditto.
	(coff_swap_aux_out): Ditto.
	(coff_swap_lineno_in): Ditto.
	(coff_swap_lineno_out): Ditto.
	(coff_swap_aouthdr_in): Ditto.
	(coff_swap_aouthdr_out): Ditto.
	(coff_swap_scnhdr_in): Ditto.
	(coff_swap_scnhdr_out): Ditto.
	* ihex.c (ihex_sizeof_headers): Ditto.
	* tekhex.c (getsym): Ditto.
	(find_chunk): Ditto & make static.
	(insert_byte): Ditto.
	(first_phase): Ditto.
	(pass_over): Ditto.
	(tekhex_get_symtab): Ditto & make static.
	(tekhex_get_symtab_upper_bound): Ditto & make static.
	(tekhex_mkobject): Ditto.
	(tekhex_object_p): Ditto.
	(move_section_contents): Ditto.
	(tekhex_get_section_contents): Ditto.
	(tekhex_set_arch_mach): Ditto & make static.
	(tekhex_set_section_contents): Ditto.
	(writevalue): Ditto.
	(writesym): Ditto.
	(out): Ditto.
	(tekhex_write_object_contents): Ditto.
	(tekhex_sizeof_headers): Ditto.
	(tekhex_make_empty_symbol): Ditto.
	(tekhex_get_symbol_info): Ditto.
	(tekhex_print_symbol): Ditto.
	* irix-core.c (make_bfd_asection): Ditto.
	(irix_core_core_file_p): Ditto.
	(irix_core_core_file_failing_command): Ditto.
	(irix_core_core_file_failing_signal): Ditto.
	(irix_core_core_file_matches_executable_p): Ditto.
	(irix_core_make_empty_symbol): Ditto.
	* coff-mips.c (mips_bfd_reloc_type_lookup): Ditto.
	* srec.c (srec_new_symbol): Ditto.
	(srec_get_section_contents): Ditto.
	(srec_set_arch_mach): Ditto.
	(srec_set_section_contents): Ditto.
	(internal_srec_write_object_contents): Ditto.
	(srec_write_object_contents): Ditto.
	(symbolsrec_write_object_contents): Ditto.
	(srec_sizeof_headers): Ditto.
	(srec_make_empty_symbol): Ditto.
	(srec_get_symtab_upper_bound): Ditto.
	(srec_get_symtab): Ditto.
	(srec_print_symbol): Ditto and make static.
	* elf.c (elf_read): Ditto
	(assign_section_numbers): Ditto.
	(elf_fake_sections): Ditto.
	(sym_is_global): Ditto.
	(elf_map_symbols): Ditto.
	(get_program_header_size): Ditto.
	* coffgen.c (make_a_section_from_file): Ditto.
	(coff_real_object_p): Ditto.
	(fixup_symbol_value): Ditto.
	(build_debug_section): Ditto.
	(copy_name): Ditto.
	* syms.c (coff_section_type): Ditto.
1996-09-11 04:25:57 +00:00
Jeff Law 00d7a64b5f * bfd-in2.h: Rebuilt after m32r changes. 1996-09-10 04:35:48 +00:00
David Edelsohn f0c12b7340 * config.bfd,configure.in,configure: Add m32r support.
* Makefile.in,archures.c,elf.c,targets.c: Likewise.
1996-09-09 22:59:40 +00:00
David Edelsohn 66e4c22978 * config.bfd,configure.in,configure: Add m32r support. 1996-09-09 19:37:47 +00:00
David Edelsohn 71d7d44f19 * config.bfd: Keep target list alphabetically sorted. 1996-09-09 19:32:40 +00:00
Jeff Law 629f776abf * elf32-v850.c (bfd_elf32_v850_reloc, case R_V850_HI16): Don't forget
to add in the constant part found in the instruction itself.
        (case R_V850_HI16_S): Likewise.
Fixes plumhall/lang.exp failures.
1996-09-09 17:49:30 +00:00
Martin Hunt 9c85b19ddf Fri Sep 6 17:04:39 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* elf32-d10v.c (elf_d10v_howto_table): Modify the size of R_D10V_16
	and R_D10V_18 to be 1 (word).
1996-09-07 00:06:53 +00:00
Ian Lance Taylor 4be2140e68 * stabs.c (_bfd_link_section_stabs): If the output_section field
of either section is bfd_abs_section, then the linker is
	discarding the section and we should not optimize it.
PR 10555.
1996-09-05 19:24:08 +00:00
Jeff Law e73b6ae634 * elf32-v850.c (bfd_elf32_v850_reloc): Fix handling of
low order sign bit propogationfor R_V850_HI16_S.
Fixes c-torture execute/950221-1.c, maybe others.
1996-09-04 03:03:53 +00:00
David Edelsohn 0cd98b92ab * Makefile.in (aout-sparcle.o): New target.
* aoutf1.h (TARGET_IS_BIG_ENDIAN_P): Don't define if little endian.
	* config.bfd (sparclet-*-aout*): Add case.
	* configure.in (sparcle_aout_vec): Add case.
	* configure: Regenerated.
	* libaout.h (machine_type): Add M_SPARCLET_LE.
	* targets.c (sparcle_aout_vec): Declare.
	(bfd_target_vector): Add sparcle_aout_vec.
	* aout-sparcle.c: New file.
1996-09-03 19:52:15 +00:00
Jeff Law 7b0af209eb * elf32-v850.c (bfd_elf3_v850_reloc): New function for
handling V850 specific relocs.
        (elf_v850_howto_table): Use the new function for some
        relocations.  Twiddle masks & shifts for some relocs.
        Set partial_inplace where needed.
Fixing more stuff.
1996-09-03 08:14:53 +00:00
Mark Alexander 71bcbd25c8 Remove reloc.c from v850_files. 1996-09-02 23:23:11 +00:00
Mark Alexander b5ef63c4fc * .Sanitize: Remove reloc.c from v850_files. 1996-09-01 22:25:50 +00:00
Ian Lance Taylor bde9d87544 * rs6000-core.c (rs6000coff_core_file_matches_executable_p):
Rewrite to use BFD file read routines and to avoid using a fixed
	length for the file name.
1996-09-01 19:44:40 +00:00
Jeff Law 237b5c4c9a * elf32-v850.c (enum reloc_type): Add R_V850_{32,16,8}.
(elf_v850_howto_table): Add support for R_V850_{32,16,8}.
        (v850_reloc_map): Add translation from BFD_RELOC_{32,16,8}
        to R_V850_{32,16,8}.
So we don't get "reloc XXX not supported" messages anymore.
1996-08-31 16:24:18 +00:00
J.T. Conklin 01b49cb35b * elf32-v850.c (reloc_type): Add R_V850_HI16_S.
(elf_v850_howto_table): Add info for HI16_S reloc.
(v850_reloc_map): Add HI_16_S reloc.
* reloc.c: Define BFD_RELOC_V850_* relocs.
1996-08-31 01:32:13 +00:00
Ian Lance Taylor c86158e591 Add SH ELF support.
* elf32-sh.c: New file.
	* elf.c (prep_headers): Handle bfd_arch_sh.
	* elfcode.h (write_relocs): Handle absolute symbol.
	* elf-bfd.h (_bfd_elf32_link_read_relocs): Declare.
	(_bfd_elf64_link_read_relocs): Declare.
	* elflink.h (NAME(_bfd_elf,link_read_relocs)): Rename from
	elf_link_read_relocs.  Make globally visible.  Change all
	callers.
	(elf_link_input_bfd): Get external symbols from cache in
	symtab_hdr->contents.  Get contents from cache in
	elf_section_data.
	* elfxx-target.h (bfD_elfNN_bfd_relax_section): Only define if not
	already defined.
	* reloc.c: Define BFD_RELOC_SH_* relocs.
	* libbfd-in.h (_bfd_sh_align_load_span): Declare.
	* coff-sh.c (sh_insns_conflict): Fix a return value.
	(_bfd_sh_align_load_span): New globally visible function, broken
	out of sh_align_load.
	(sh_align_load): Call _bfd_sh_align_load_span.
	(sh_swap_insns): Change relocs parameter to PTR.
	* bfd-in2.h, libbfd.h: Rebuild.
	* targets.c (bfd_elf32_sh_vec): Declare.
	(bfd_elf32_shl_vec): Declare.
	* config.bfd (sh-*-elf*): New target.
	* configure.in (bfd_elf32_sh_vec): New target vector.
	(bfd_elf32_shl_vec): New target vector.
	* configure: Rebuild.
	* Makefile.in: Rebuild dependencies.
 	(BFD32_BACKENDS): Add elf32-sh.o.
	(BFD32_BACKENDS_CFILES): Add elf32-sh.c.

	* elf.c (map_sections_to_segments): Check that LMA does not skip a
	page before checking D_PAGED.
1996-08-30 22:09:51 +00:00
Ian Lance Taylor 492cfc71b8 * ihex.c (ihex_scan): Removed unnecessary extbase variable.
(ihex_write_object_contents): Remove extbase; always use segbase
	instead.
1996-08-30 15:52:40 +00:00
Michael Meissner f7954d868f Recognize i686-*-* for pentium pro 1996-08-29 21:16:27 +00:00
Ian Lance Taylor 4da624ddb3 * elf32-mips.c (mips_elf_check_relocs): Set dynobj if needed for
R_MIPS_32 and R_MIPS_REL32.  Set sgot and g as soon as possible.
	(mips_elf_size_dynamic_sections): Don't require .got to exist.
	(mips_elf_finish_dynamic_sections): Likewise.
1996-08-27 04:14:13 +00:00
Ian Lance Taylor 1c952df609 * configure.host (HLDENV): New variable to set. Set it for
*-*-sysv4*, since those linkers may not support -R but they always
	support LD_RUN_PATH.
1996-08-23 00:07:59 +00:00
Ian Lance Taylor 9461513b04 * libieee.h (NSECTIONS): Don't define.
(ieee_data_struct): Change section_table to asection **.  Add
	section_table_size.
	* ieee.c (get_section_entry): If the table isn't big enough, make
	it bigger.
	(ieee_slurp_sections): Remove assertion about number of sections.
	(ieee_object_p): Adjust initialization of ieee to match changes to
	the structure.
PR 10377.
1996-08-23 00:02:55 +00:00
J.T. Conklin 0c1d95c791 * Makefile.in (ALL_MACHINES): Add cpu-v850.o.
(BFD32_BACKENDS) Add elf32-v850.o.
* archures.c: Add bfd_v850_arch.
* bfd-in2.h: Add bfd_v850_arch.
* config.bfd (v850-*-*): New target.
* configure: (bfd_elf32_v850_vec) New vector.
* configure.in: (bfd_elf32_v850_vec) New vector.
* cpu-v850.c: New file.
* elf.c (prep_headers): Added case bfd_arch_v850.
* elf32-v850.c: New file.
* targets.c (bfd_elf32_v850_vec): New vector.
1996-08-20 22:09:25 +00:00
Stan Shebs 22edd54732 * mpw-config.in: Update editing of autoconf vars to reflect
Jul 18 configure.in change.
	* mpw-make.sed: Update editing of include pathnames to be
	more general, add @DASH_C_FLAG@ to explicit compile rule edit.
1996-08-15 19:41:17 +00:00
Jackie Smith Cashion 53ef6e6076 Thu Aug 15 16:40:30 1996 James G. Smith <jsmith@cygnus.co.uk>
* reloc.c: (BFD_RELOC_ARM_THUMB_ADD, BFD_RELOC_ARM_THUMB_IMM,
	BFD_RELOC_ARM_THUMB_SHIFT, BFD_RELOC_ARM_THUMB_OFFSET):
 	Added, for internal use by the ARM gas.
	* libbfd.h: Rebuilt
	* bfd-in2.h: Rebuilt
1996-08-15 15:58:35 +00:00
Ian Lance Taylor 37d7888d03 Wed Aug 14 17:02:09 1996 Richard Henderson <rth@tamu.edu>
* elf64-alpha.c (elf64_alpha_size_dynamic_sections): Correct typo
	in section dynidx start.
1996-08-15 00:03:50 +00:00
Ian Lance Taylor e38d6d362f * elf.c (_bfd_elf_make_section_from_shdr): Treat sections whose
name begins with .gnu.linkonce as SEC_LINK_ONCE.  This is an
	optimization for g++.
1996-08-13 21:39:37 +00:00
Michael Meissner ae20860e9d If one module has -mrelocatable-lib and the other doesn't, clear the -mrelocatable-lib bit 1996-08-13 21:09:06 +00:00
Ian Lance Taylor 4596421b67 * elflink.h (elf_link_add_object_symbols): Do not resolve a common
symbol against a STT_FUNC symbol in a shared library.
1996-08-11 03:39:46 +00:00
Ian Lance Taylor 410bc61d0c * xcofflink.c (xcoff_link_add_dynamic_symbols): If a descriptor
symbol is found, automatically define the corresponding function
 	code.
PR 10299.
1996-08-10 00:15:30 +00:00
Ian Lance Taylor d92099f198 * cofflink.c (coff_link_add_symbols): Only set (*sym_hash)->numaux
if sym.n_numaux is not zero.
	(_bfd_coff_link_input_bfd): Permit the symbol and the hash table
	entry to disagree about the number of aux entries if the symbol
	has zero.
1996-08-09 18:46:54 +00:00
Ian Lance Taylor f11e3f6278 * elf32-mips.c (mips_elf_check_relocs): Create the .rel.dyn
section if it might be needed, not just if info->shared.
	(mips_elf_adjust_dynamic_symbol): Make room for a null element at
	the start of .rel.dyn if we are going to use it.
	(mips_elf_finish_dynamic_sections): Only clear the first element
	of .rel.dyn if the size is greater than zero.
Fix this case from c-torture:
extern int abort();
typedef int (*frob)();
frob f[] = {abort};
main()
{
  exit(0);
}
1996-08-09 16:47:15 +00:00
Ian Lance Taylor b2a05baf21 * xcofflink.c (xcoff_link_input_bfd): If we already called the
undefined_symbol callback for a symbol, then don't issue any more
	warnings about loader relocs.
	(_bfd_ppc_xcoff_relocate_section): Don't do any further processing
	after calling the undefined_symbol callback.
1996-08-08 21:15:32 +00:00
Ian Lance Taylor fbc4ed7ded * xcofflink.c (XCOFF_MULTIPLY_DEFINED): Define.
(xcoff_link_add_symbols): Permit multiple definitions of a symbol
	as the AIX linker seems to do.
PR 10304.
1996-08-08 20:33:39 +00:00
Ian Lance Taylor 8612a388f7 Thu Aug 8 12:21:56 1996 Klaus Kaempf <kkaempf@progis.de>
* evax-alpha.c (evax_alpha_vec): Corrected flags, cleanup.
	(evax_initialize): Remove evax_reloc_table.
	(evax_close_and_cleanup): Ditto.
	(reloc_nil): Ditto.
	(alpha_howto_table): Remove ALPHA_R_SWREL32 and ALPHA_R_SWREL64
	entries.
	(evax_bfd_reloc_type_lookup): Ditto.
	* evax-egsd.c (_bfd_evax_slurp_egsd): Add a few casts; set
	cooked_size == raw_size.
	* evax-emh.c (_bfd_evax_register_filename): Remove.
	* evax-etir.c (etir_stc): Allow ETIR_S_C_STC_xx commands.
	* evax-misc.c (add_new_contents): Malloc section at full size.
	(_bfd_save_evax_section): Memcpy section contents directly.
	* evax.h (ALPHA_R_SWREL32, ALPHA_R_SWREL64): Remove.
	(evax_reloc_table): Remove.

	* hosts/alphavms.h (O_ACCMODE): Define if needed.

	* makefile.vms: Add better support for DEC C compilation
	Add evax.h dependencies

	* reloc.c (bfd_get_reloc_size): Add case for 16 byte reloc.
	(BFD_RELOC_SWREL32,BFD_RELOC_SWREL64): Remove.
	(BFD_RELOC_ALPHA_BASEREG): Remove.
	* bfd-in2.h, libbfd.h: Rebuild.
1996-08-08 16:27:21 +00:00
Stu Grossman 320a5c6b18 * archive.c (bsd_write_armap): Ifdef around calls to getuid and
getgid if _WIN32 is defined.
	* opncls.c (bfd_fdopenr):  Remove unnecessary WINGDB ifdef.
1996-08-08 15:23:01 +00:00
Stu Grossman 2055bf857d * aoutx.h bfd-in.h bfd-in2.h opncls.c riscix.c som.c targets.c:
Change NO_FLAGS to BFD_NO_FLAGS to avoid conflict with an HPUX
	include file.
	* libbfd.c:  Create dummy getpagesize() macro if HAVE_GETPAGESIZE
	isn't defined.
1996-08-08 06:27:01 +00:00
Ian Lance Taylor cc425b5558 * cpu-i386.c (i8086_arch): Architecture info for the i8086. 1996-08-07 20:10:14 +00:00
Ian Lance Taylor 85fe9d3e46 Wed Aug 7 14:11:44 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* configure.in: Call BFD_NEEDED_DECLARATION on strstr and
	realloc.
	* acconfig.h (NEED_DECLARATION_STRSTR): New macro.
	(NEED_DECLARATION_REALLOC): New macro.
	* configure, config.in: Rebuild.
	* sysdep.h (strstr): Declare if NEED_DECLARATION_STRSTR.
	(realloc): Declare if NEED_DECLARATION_REALLOC.
1996-08-07 18:17:22 +00:00
Ian Lance Taylor 9b3307b0a0 Based on patches from Eric Valette <valette@crf.canon.fr>:
* elf32-i386.c (enum reloc_type): Add FIRST_INVALID_RELOC,
	LAST_INVALID_RELOC, R_386_16, R_386_PC16, R_386_8, R_386_PC8.
	(elf_howto_table): Add entries for new relocs.
	(elf_i386_reloc_type_lookup): Handle new relocs.
	(elf_i386_info_to_howto): Just call abort.
	(elf_i386_info_to_howto_rel): Check that the reloc type is valid.
	(elf_i386_relocate_section): Likewise.
1996-08-07 16:14:09 +00:00
Martin Hunt 75e3a45a0d Tue Aug 6 12:54:56 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* elf32-d10v.c (elf_d10v_howto_table): Added R_D10V_32.
1996-08-06 19:56:21 +00:00
Ian Lance Taylor b944e7e855 * elf.c (_bfd_elf_make_section_from_shdr): For a loadable section,
only get the LMA from the phdr if they are in the same part of the
	file.
1996-08-05 20:45:55 +00:00
Ian Lance Taylor 191d910cb9 * elf.c (map_sections_to_segments): Rewrite tests for starting a
new segment to make them more comprehensible.  If the relationship
	between the LMA and the VMA changed, start a new segment.  Don't
	check dynsec when deciding whether to start a new segment for a
	writeable section; -N will now handle this.
1996-08-05 17:45:58 +00:00
Jeff Law e751d5068f * libhppa.h: Remove "esel" changes. Not the right approach.
* som.c: Corresponding changes.
        (som_bfd_derive_misc_symbol_info): Use ST_DATA for symbols
        which don't have a SOM symbol type associated with them.
        Reverses a 1994 change.
More PA EH tweakage (to get exception handling tables properly relocated
in shared libraries).
1996-08-02 04:50:08 +00:00
Ian Lance Taylor cdb88e8764 Make ld -N more reasonable for ELF:
* elf.c (map_sections_to_segments): If D_PAGED is not set, set
	phdr_in_section to false, and always use a single load segment.
	(elf_sort_sections): Sort sections by LMA after VMA.
	(assign_file_positions_for_segments): If D_PAGED is not set, don't
	align to maxpagesize.
	(assign_file_positions_except_relocs): Likewise.
	* elfcode.h (elf_object_p): If a section is loaded but not page
	aligned, clear D_PAGED.
1996-07-31 19:58:05 +00:00
Jackie Smith Cashion d1b40d8eeb Wed Jul 31 15:00:12 1996 James G. Smith <jsmith@cygnus.co.uk>
* reloc.c: (BFD_RELOC_ARM_OFFSETIMM8, BFD_RELOC_ARM_HWLITERAL):
 	Added, for internal use by the ARM gas.
	* libbfd.h: Rebuilt
	* bfd-in2.h: Rebuilt
1996-07-31 14:34:21 +00:00
Jeff Law ad240a8289 * libhppa.h (R_HPPA_ESEL): New field selector.
(e_esel): Similarly.
        * som.c (hppa_som_gen_reloc_type): If we encounter an e_esel,
        then generate R_COMP2 (PUSH_SYM), R_DATA_EXPR fixup stream.
        (som_write_fixups): Handle R_DATA_EXPR just like R_CODE_EXPR.
Making another stab at EH support on the PA.
1996-07-30 20:16:27 +00:00
Ian Lance Taylor fb4dc1eb5f * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Do the regular
archive search before looking for stripped dynamic objects.
PR 10187.
1996-07-30 17:39:33 +00:00
Ian Lance Taylor b223f95038 * xcofflink.c (xcoff_build_ldsyms): Make exporting an undefined
symbol a warning rather than an error.
PR 10208.
1996-07-26 21:53:08 +00:00
Ian Lance Taylor a4e07bb49e tipo 1996-07-24 23:11:13 +00:00
Ian Lance Taylor 64f808f92b * elf.c (assign_file_positions_for_segments): Track the virtual
memory position separately from the file position, and use it to
	compute the alignment adjustment.
PR 10039.
1996-07-24 16:05:32 +00:00
Martin Hunt 11609502f0 start-sanitize-d10v
Tue Jul 23 10:43:31 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>

	* elf32-d10v.c (elf_d10v_howto_table): Changed all relocs to "long"
 	and fixed mask on R_D10V_10_PCREL_L.

end-sanitize-d10v
1996-07-23 17:54:21 +00:00
Ian Lance Taylor bf9884d41d * elf64-mips.c: Include "aout/ar.h".
(mips_elf64_slurp_armap): New static function.
	(mips_elf64_write_armap): New static function.
	(bfd_elf64_archive_*): Define.
	* elfxx-target.h (bfd_elfNN_archive_p): Define if not defined.
	Use instead of bfd_generic_archive_p.
	(bfd_elfNN_write_archive_contents): Define if not defined.  Use
	instead of _bfd_write_archive_contents.
	(bfd_elfNN_mkdarchive): Define if not defined.  Use instead of
	_bfd_generic_mkarchive.
	(TARGET_BIG_SYM): If bfd_elfNN_archive_functions is defined, use
	bfd_elfNN_archive in BFD_JUMP_TABLE_ARCHIVE rather than
	_bfd_archive_coff.
	(TARGET_LITTLE_SYM): Likewise.
	* archive.c (bfd_slurp_armap): Check for and reject an archive map
	name of /SYM64/.
	* Makefile.in: Rebuild dependencies.
1996-07-22 23:02:35 +00:00
Ian Lance Taylor 1cfe12f298 * elf32-mips.c (_bfd_mips_elf_final_write_processing): Handle
SHT_MIPS_LIBLIST, SHT_MIPS_CONTENT, SHT_MIPS_SYMBOL_LIB, and
	SHT_MIPS_EVENTS sections.
	(_bfd_mips_elf_section_from_shdr): Handle SHT_MIPS_IFACE,
	SHT_MIPS_CONTENT, SHT_MIPS_SYMBOL_LIB, and SHT_MIPS_EVENTS
	sections.
	(_bfd_mips_elf_fake_sections): Likewise.
1996-07-22 23:02:02 +00:00
Ian Lance Taylor 9bd65136af * libecoff.h (ecoff_data_type): Add rdata_in_text field.
* ecoff.c (ecoff_compute_section_file_positions): Copy
	rdata_in_text from backend info to tdata.  Clear it if any data
	section comes before .rdata.
	(_bfd_ecoff_write_object_contents): Use rdata_in_text field in
	tdata rather than backend info.
1996-07-22 19:38:23 +00:00
Ian Lance Taylor 194141a9b8 * configure.in: Fix test for whether a compiler has a 64 bit
type.  From Jim Wilson <wilson@cygnus.com>.
VS: ----------------------------------------------------------------------
1996-07-19 22:16:50 +00:00
Ian Lance Taylor f4e14cb901 * configure.in: Set and substitute VERSION, BFD_HOST_64BIT_LONG
(replacing HOST_64BITLONG), BFD_HOST_64_BIT_DEFINED,
	BFD_HOST_64_BIT, and BFD_HOST_U_64_BIT.  Add bfd-in2.h:bfd-in2.h
	to AC_OUTPUT call.
	* configure: Rebuild.
	* bfd-in.h (BFD_ARCH_SIZE): Define as @wordsize@, not @WORDSIZE@.
	(BFD_HOST_64_BIT): Define conditionally.
	(BFD_HOST_U_64_BIT): Define when BFD_HOST_64_BIT is defined.
	(bfd_vma): Typedef as BFD_HOST_U_64_BIT.
	(symvalue, bfd_size_type): Likewise.
	* bfd-in2.h: Rebuild.
	* Makefile.in (do_clean): Remove bfd-tmp.h.
	(do_distclean): Remove bfd-in3.h.
	(stmp-bfd.h): Just do copy-if-change bfd-in3.h bfd.h.
	(bfd-in3.h): New target.
1996-07-19 00:48:20 +00:00
Ian Lance Taylor 0f61272947 rebuild 1996-07-19 00:46:50 +00:00
Ian Lance Taylor 74556b94ff * config.bfd (sparc-*-sysv4*): Don't build sunos_big_vec. From
Andrew Gierth <ANDREWG@microlise.co.uk>.
1996-07-18 21:36:21 +00:00
Ian Lance Taylor ab659fd6de * configure.host: Set INSTALL_SHLIB.
* configure.in: Call AC_SUBST (INSTALL_SHLIB).
	* configure: Rebuild.
	* Makefile.in (install): Use @INSTALL_SHLIB@.
1996-07-18 21:19:11 +00:00
Ian Lance Taylor e8c249cb2c * config.bfd (mips*-*-irix6*): New target.
* configure.host: Handle Irix 6 shared library like Irix 5.
1996-07-18 20:33:22 +00:00
Ian Lance Taylor a8a3d83af0 * xcofflink.c (xcoff_link_add_symbols): Don't check an XMC_TD
symbol for a magic name.
	(xcoff_link_input_bfd): Don't change the reloc symbol for an
	XMC_TD symbol.
	(_bfd_ppc_xcoff_relocate_section): Don't get the TOC offset for an
	XMC_TD symbol.
1996-07-18 19:41:35 +00:00
Stan Shebs b576c7b3d2 * mpw-config.in: Add ELF support to mips config, create the
elf32-target.h file in the object dir.
	* mpw-make.sed: Edit elfXX-target.h refs at beginnings of lines.
1996-07-18 18:42:06 +00:00
Kim Knuttila 2ba0d82d52 Removed debug, fixed diagnostics, etc 1996-07-18 01:04:14 +00:00
Martin Hunt 50bd50d48f start-sanitize-d10v
Wed Jul 17 14:51:52 1996  Martin M. Hunt  <hunt@pizza.cygnus.com>
        * Makefile.in (ALL_MACHINES): Add cpu-d10v.o
        (BFD32_BACKENDS) Add elf32-d10v.o
        * archures.c: Add bfd_d10v_arch.
        * bfd-in2.h: Add bfd_d10v_arch.
        * config.bfd (d10v-*-*): New target.
        * configure: (bfd_elf32_d10v_vec) New vector.
        * configure.in: (bfd_elf32_d10v_vec) New vector.
        * cpu-d10v.c: New file.
        * elf.c (prep_headers): Added case bfd_arch_d10v.
        * elf32-d10v.c: New file.
        * libbfd.h: Rebuild.
        * reloc.c (BFD_RELOC_D10V_10_PCREL_R, BFD_RELOC_D10V_10_PCREL_L, BFD_RELOC_D10V_18,
          BFD_RELOC_D10V_18_PCREL): Define.
        * targets.c (bfd_elf32_d10v_vec): New vector.
end-sanitize-d10v
1996-07-18 00:47:05 +00:00
Kim Knuttila 2ce9802e14 Removed bogus printf 1996-07-17 18:10:20 +00:00
Ian Lance Taylor 4b2ef5d8bf remove sanitization accidentally inserted in last commit 1996-07-17 13:28:31 +00:00
Stu Grossman 9676e4461a * archures.c bfd-in2.h: Add bfd_mach_i386_i386 and
bfd_mach_i386_i8086 machine types.
1996-07-17 06:51:21 +00:00
Stu Grossman 3cc21bf602 * bfd-in2.h: Add bfd_mach_i386_i386 and bfd_mach_i386_i8086
machine types.
1996-07-15 23:41:21 +00:00
Ian Lance Taylor f71719789e * ecoff.c (_bfd_ecoff_new_section_hook): Set SEC_CODE for _INIT
and _FINI sections.
1996-07-10 16:44:45 +00:00
Ian Lance Taylor 74e2ab383c Wed Jul 10 11:18:21 1996 Richard Henderson <rth@tamu.edu>
* coffcode.h (coff_set_section_contents): A/UX does not require
	special handling of the _LIB section.
1996-07-10 15:26:50 +00:00
Jeff Law 01cfaa6bf2 * coff-h8300.c (h8300_reloc16_extra_cases): Use the correct
value for R_RELBYTE.
Something -Wall caught.

        * reloc16.c (bfd_coff_reloc16_relax_section): Only "shrinks"
        array if one was allocated.
Something I ran into today.
1996-07-09 21:53:47 +00:00
Ian Lance Taylor eb52b9dc1d From Kazumoto Kojima <kkojima@kk.info.kanagawa-u.ac.jp>:
* elf32-mips.c (struct mips_elf_link_hash_table): Add new fields
	use_rld_obj_head and rld_value.
	(mips_elf_link_hash_table_create): Initialize new fields.
	(mips_elf_add_symbol_hook): Mark __rld_obj_head symbol as
	dynamic.
	(mips_elf_create_dynamic_sections): Create .rld_map section.  If
	__rld_obj_head symbol not seen, create an __rld_map symbol.
	(mips_elf_size_dynamic_sections): Make space in .rld_map section.
	Create a DT_MIPS_RLD_MAP entry rather than a DT_DEBUG entry.
	(mips_elf_finish_dynamic_symbol): Save value of __rld_map or
	__rld_obj_head symbol.
	(mips_elf_finish_dynamic_sections): Handle DT_MIPS_RLD_MAP.
1996-07-09 16:28:04 +00:00
Ian Lance Taylor 9b292d4c0e * elf32-mips.c (mips_reloc_map): Remove BFD_RELOC_32_PCREL entry. 1996-07-08 23:29:26 +00:00
Ian Lance Taylor dab4573409 * elf32-ppc.c (ppc_elf_howto_raw): For R_PPC_ADDR16_HA, use
ppc_elf_addr16_ha_reloc.
	(ppc_elf_addr16_ha_reloc): New static function.
PR 10036.
1996-07-08 21:38:59 +00:00
Ian Lance Taylor 56b4cbaac3 * coff-mips.c (struct mips_hi): Define.
(mips_refhi_list): New static variable.
 	(mips_refhi_addr, mips_refhi_addend): Remove.
	(mips_refhi_reloc): Maintain a list of unmatched REFHI relocs.
	(mips_reflo_reloc): Process mips_refhi_list.
	(mips_relhi_list): New static variable.
	(mips_relhi_addr, mips_relhi_addend): Remove.
	(mips_relhi_reloc): Maintain a list of unmatched RELHI relocs.
	(mips_rello_reloc): Process mips_relhi_list.
	(mips_relocate_section): Permit an arbitrary number of REFHI or
	RELHI relocs before the associated REFLO or RELLO reloc.
PR 10050.
1996-07-08 20:25:54 +00:00
Ian Lance Taylor b777c6a733 * aout-target.h (MY(callback)): Set reloc_count fields. 1996-07-05 23:30:05 +00:00
Jeff Law 34255b708c No longer need to sanitize away h8/s stuff. 1996-07-05 18:30:03 +00:00
Ian Lance Taylor 48f3aaf3ed * sunos.c (sunos_add_dynamic_symbols): Don't create dynamic
sections unless this is a SunOS link.
PR 10039.
1996-07-04 22:25:50 +00:00
Ian Lance Taylor 100b65dd23 * VERSION: Set to 2.7.1. 1996-07-04 19:35:51 +00:00
Ian Lance Taylor 4d3daf4fae * i386aout.c: Include "aout/aout64.h".
(i386aout_write_object_contents): New static function.
	(MY_write_object_contents): Define.
1996-07-03 20:50:56 +00:00
Ian Lance Taylor a31e14f44c * netbsd.h (MY(write_object_contents)): Make sure that
adjust_sizes_and_vmas is called before fiddling with the magic
	number.
1996-07-03 19:01:14 +00:00
Ian Lance Taylor d2d04f7a28 * stabs.c (_bfd_link_section_stabs): Fix casts of psinfo. 1996-07-03 03:32:48 +00:00
Ian Lance Taylor 4f6ee760ca * libbfd-in.h (itos, stoi): Don't define.
* libbfd.h: Rebuild.
	* i386lynx.c (KEEPIT): Define as udata.i.
	(NAME(lynx,swap_std_reloc_out)): Don't use stoi.
	(NAME(lynx,swap_ext_reloc_out)): Likewise.
	* riscix.c (riscix_swap_std_reloc_out): Use udata.i rather than
	flags.  Don't use stoi.
1996-06-30 17:42:02 +00:00
Kim Knuttila dfb89b82d4 Fixed the ppc/nt strip bug. Missing D_PAGED. 1996-06-29 23:25:23 +00:00
Ian Lance Taylor f93fb27543 * xcofflink.c (xcoff_link_check_ar_symbols): An undefined symbol
with XCOFF_DEF_DYNAMIC set is really defined.
	(xcoff_link_check_dynamic_ar_symbols): Likewise.
The above is for PR 9997.
	(xcoff_link_add_symbols): Only create special sections if using an
	XCOFF hash table.
1996-06-28 22:19:46 +00:00
Ian Lance Taylor 8e80606fab * reloc.c (bfd_perform_relocation): Handle xcoff-powermac like
aixcoff-rs6000.
	(bfd_install_relocation): Likewise.
1996-06-28 17:50:36 +00:00
Ian Lance Taylor eec2f824fb Fri Jun 28 11:17:00 1996 Richard Henderson <rth@tamu.edu>
* elf64-alpha.c (struct alpha_elf_link_hash_entry): Add flags
	field.
	(ALPHA_ELF_LINK_HASH_LU_ADDR): Define.
	(ALPHA_ELF_LINK_HASH_LU_MEM): Define.
	(ALPHA_ELF_LINK_HASH_LU_FUNC): Define.
	(elf64_alpha_link_hash_newfunc): Initialize flags field.
	(elf64_alpha_check_relocs): Record types of LITUSE entries that
	are found for LITERAL relocs.
	(elf64_alpha_adjust_dynamic_symbol): If a symbol has its address
	taken, we cannot generate a .plt entry for the symbol.
1996-06-28 15:24:18 +00:00
Ian Lance Taylor 5304aea938 * configure.in: Add AC_ISC_POSIX, and check for setitimer and
sysconf functions (for gprof).
	* configure, config.in: Rebuild.
1996-06-27 15:29:21 +00:00
Ian Lance Taylor f292bbe9cf * ecoff.c (_bfd_ecoff_archive_p): Check the first object file in
an archive if it has a map.  If the object file has the wrong
	xvec, reject it.
PR 9972.
1996-06-27 01:44:49 +00:00
Ian Lance Taylor 566e232559 * coff-alpha.c (alpha_adjust_reloc_in): Set the addend for a
BRADDR, SREL16, SREL32, or SREL64 reloc against an external
	symbol.
	(alpha_relocate_section): Likewise.
1996-06-26 21:27:09 +00:00
Ian Lance Taylor 017047d446 * coffswap.h (coff_swap_reloc_out): Use RELSZ, not sizeof.
(coff_swap_filehdr_out): Use FILHSZ, not sizeof.
	(coff_swap_sym_out): Use SYMESZ, not sizeof.
	(coff_swap_aux_out): Use AUXESZ, not sizeof.
	(coff_swap_lineno_out): Use LINESZ, not sizeof.
	(coff_swap_aouthdr_out): Use AOUTSZ, not sizeof.
	(coff_swap_scnhdr_out): Use SCNHSZ, not sizeof.
	* peicode.h: Corresponding changes.
1996-06-26 20:32:22 +00:00