aboutsummaryrefslogtreecommitdiff
path: root/bfd/reloc.c
AgeCommit message (Collapse)AuthorFilesLines
1995-01-12Change "reloc_howto_type" typedef to be "const", since all uses of it are (orKen Raeburn1-7/+19
should be) anyways.
1994-11-17* reloc.c (bfd_reloc_code_type): Add new value BFD_RELOC_12_PCREL.Ken Raeburn1-6/+9
* bfd-in2.h, libbfd.h: Rebuilt.
1994-09-28 * reloc.c (bfd_install_relocation): Cast data_start to bfd_byte *Ian Lance Taylor1-0/+470
before trying to add values to it.
1994-09-02* reloc.c (enum bfd_reloc_code_real): Rewrote definition to use new "chew"Ken Raeburn1-218/+357
commands for simultaneous definition of enumerator and enumerator name table. (bfd_get_reloc_code_name): New function, for retrieving a symbolic name associated with an enumerator. * libbfd.h, bfd-in2.h: Regenerated.
1994-07-14NS32K changes from Ian Dall.Ken Raeburn1-8/+45
Note: Some of the ns32k-specific files do require gcc to compile at present. This will be fixed.
1994-06-15unsanitize v9Ken Raeburn1-99/+6
1994-03-31Missing BFD_RELOC_26.Sean Eric Fagan1-0/+1
1994-03-30Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)Ian Lance Taylor1-214/+222
Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-10 * libbfd-in.h: Remove alloca cruft. It was missing some necessaryJim Kingdon1-21/+31
cruft (like the #pragma alloca for AIX). In addition to that problem, the C alloca calls xmalloc, which means checking for being out of memory can't work right. The following changes remove all uses of alloca from BFD. * hosts/solaris2.h: Remove alloca cruft. * som.c: Replace alloca with a fixed size auto array. * aoutx.h, elfcode.h, nlmcode.h, bout.c, coff-alpha.c, ecoff.c, ecofflink.c, elf32-hppa.c, elf32-mips.c, linker.c, reloc.c, som.c: Replace alloca with malloc and appropriate error checking and freeing. * linker.c: Replace alloca with obstack_alloc. * libbfd.h: Rebuilt.
1994-02-26 * reloc.c (_bfd_relocate_contents): Adjust handling of overflow toIan Lance Taylor1-9/+33
avoid depending upon right shifts of signed numbers, and to correct handling of src_mask with lower bits zero.
1994-01-25 * reloc.c (bfd_get_reloc_size): Size of type -2 is 4 bytes, not 2.Ian Lance Taylor1-1/+1
1994-01-24 * bfd/aoutx.h (aout_link_input_section_std,Ian Lance Taylor1-1/+3
aout_link_input_section_ext): Pass additional arguments to reloc_overflow callback. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents, alpha_relocat_section): Likewise. * coff-h8300.c (h8300_reloc16_extra_cases): Likewise. * coff-h8500.c (extra_case): Likewise. * coff-mips.c (mips_relocate_section): Likewise. * coff-z8k.c (extra_case): Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
1994-01-19(enum bfd_reloc_code_real): Add some Alpha relocation types. Reorganized someKen Raeburn1-14/+71
of the existing ones.
1993-12-30 Extensive changes to move the bulk of the linker into BFD so thatIan Lance Taylor1-81/+346
more efficient backend code can be written for specific object files. Only existing efficient backend is a.out. * seclet.c, seclet.h: Removed. * hash.c, linker.c, genlink.h: New files. * bfd-in.h: Removed bfd_error_vector. Declared hash table structures and functions. (JUMP_TABLE): Removed bfd_seclet_link, added bfd_link_hash_table_create, bfd_link_add_symbols and bfd_final_link. * All backends: Changed accordingly. * bfd-in2.h: Rebuilt. * bfd.c (struct _bfd): Added link_next and archive_pass fields. Removed ld_symbols field. (bfd_nonrepresentable_section, bfd_undefined_symbol, bfd_reloc_value_truncated, bfd_reloc_is_dangerous, bfd_error_vector): Removed. (bfd_default_error_trap, bfd_error_trap, bfd_error_nonrepresentabltrap): Removed. (bfd_get_relocated_section_contents): Pass link_info. Pass link_order instead of seclet. Pass symbols. (bfd_relax_section): Pass link_info. (bfd_seclet_link): Removed. (bfd_link_hash_table_create, bfd_link_add_symbols, bfd_final_link): New macros. * libbfd-in.h: If __GNUC__ is defined and alloca is not, define alloca as __builtin_alloca. Declare internal linking functions. * libbfd.h: Rebuilt. * libbfd.c (bfd_seek): Comment out fseek assertion. It's worked for months. * reloc.c (reloc_howto_type): Added error_message argument to special_function field. Changed all callers and all definitions. (bfd_get_reloc_size): Make argument a const pointer. (bfd_perform_relocation): Add error_message argument to hold string set if return value if bfd_reloc_dangerous. Changed all callers. (_bfd_final_link_relocate, _bfd_relocate_contents): New functions. * section.c (asection): Renamed seclets_head and seclets_tail to link_order_head and link_order_tail. * targets.c (bfd_target): Replaced seclet argument with link_info and link_order and symbols arguments in bfd_get_relocated_section_contents. Added symbols argument to bfd_relax_section. Removed bfd_seclet_link. Added bfd_link_hash_table_create, bfd_link_add_symbols and bfd_final_link. * libaout.h (struct aoutdata): Added external_syms, external_sym_count, external_strings, sym_hashes fields. (obj_aout_external_syms, obj_aout_external_sym_count, obj_aout_external_strings, obj_aout_sym_hashes): New accessor macros. (WRITE_HEADERS): Only output symbols if outsymbols is not NULL. * aoutx.h: Wrote new back end linker routines. (translate_to_native_sym_flags): Return boolean value. Don't use bfd_error_vector. (NAME(aout,write_syms)): Return boolean value. Check return value of translate_to_native_sym_flags and bfd_write. * aout-target.h (final_link_callback): New function. (MY_bfd_final_link): New function. * aout-adobe.c (aout_adobe_write_object_contents): Check return value of aout_32_write_syms. * hp300hpux.c (MY(write_object_contents)): Likewise. * i386lynx.c (WRITE_HEADERS): Likewise. * libaout.h (WRITE_HEADERS): Likewise. * bout.c: Changed functions to use link_info->callbacks rather than bfd_error_vector, and link_orders rather than seclets. * coff-alpha.c: Likewise. * coff-h8300.c: Likewise. * coff-h8500.c: Likewise. * coff-sh.c: Likewise. * coff-z8k.c: Likewise. * elf32-hppa.c: Likewise. * reloc16.c: Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look up _gp in the hash table rather than in outsymbols. * coff-a29k.c (a29k_reloc): Pass errors back in new error_message argument rather than printing them. * coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and link_order arguments rather than seclet. Changed all uses and definitions. (bfd_coff_reloc16_estimate): Pass link_info arguments. Changed all uses and definitions. * libcoff.h: Rebuilt. * ecoff.c (ecoff_get_extr): If symbol is defined by linker, but not by ECOFF, make it scAbs. (ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and rewritten. * elf32-mips.c (mips_elf_final_link): Renamed from mips_elf_seclet_link and rewritten. * elf32-hppa.c (elf32_hppa_stub_description): Added link_info field. (new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub, hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section): Added link_info arguments. Changed all callers. * elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is not NULL. * oasys.c (oasys_write_sections): Return boolean value rather than using bfd_error_vector. (oasys_write_object_contents): Check return value of oasys_write_sections. * hosts/std-host.h: Don't declare qsort or strtol. * Makefile.in: Rebuild dependencies. (BFD_LIBS): Removed seclet.o. Added hash.o and linker.o. (CFILES): Removed seclet.c. Added hash.c and linker.c. (HFILES): Removed seclet.h. Added genlink.h.
1993-11-05fix mistakes in last changeDavid MacKenzie1-97/+0
1993-11-05doc cleanupDavid MacKenzie1-65/+287
1993-10-07* aoutx.h (howto_table_std): Correct the "size" field in some entries.Ken Raeburn1-54/+75
* reloc.c (reloc_howto_type): Change documentation to dispel any notion that the "size" field is a power-of-two indicator.
1993-08-05add i386-elf relocs (from Meissner)Ken Raeburn1-2/+29
1993-07-26(bfd_perform_relocation): Handle 64-bit relocs.Ken Raeburn1-39/+68
1993-07-22 * reloc.c (enum complain_overflow): New enumeration with theIan Lance Taylor1-19/+79
various flavours of overflow checking. (srtuct reloc_howto_struct): Changed complain_on_overflow field from boolean to emum complain_overflow. Removed obsolete absolute field. (HOWTO): Removed absolute argument. (bfd_perform_relocation): Do overflow checking on all types of fields. * bfd-in2.h: Updated accordingly. * all targets: Updated initialization of reloc howto tables.
1993-07-12(enum bfd_reloc_code_real): Move SPARC_BASE13 and SPARC_WDISP19 to moreKen Raeburn1-92/+78
appropriate places. (bfd_perform_relocation): Whitespace changes, more comments.
1993-07-06(enum bfd_reloc_code_real): Put simple power-to-two relocs together, and addKen Raeburn1-14/+33
64-bit versions. Also add sparc v9 reloc types. (bfd_generic_get_relocated_section_contents): Argument to alloca is size_t.
1993-06-19 * reloc.c (bfd_perform_relocation): Check for overflow onDavid MacKenzie1-97/+234
pc-relative relocations if the howto asked for it.
1992-11-05Cleanup: Replace all uses of EXFUN in the BFD sources, with PARAMS.John Gilmore1-3/+3
* archures.c, reloc.c, section.c, tekhex.c: Use PARAMS in declaring pointers to functions. * cache.c, elf.c: Move static function decls to top, use PARAMS. * seclet.h: Declare external function with PARAMS. * libbfd.h: Update, based on changes in source code and chew.
1992-10-23Fri Oct 23 10:32:36 1992 Steve Chamberlain (sac@thepub.cygnus.com)Steve Chamberlain1-14/+38
* seclet.c (rel): don't load sections without the SEC_LOAD bit. Thu Oct 15 10:16:35 1992 Steve Chamberlain (sac@thepub.cygnus.com) * coff-m68k.c (m68k_howto2type, SELECT_RELOC): new function to work out a coff relocation type from a howto's attributes rather than using the input r_type field. This fixes PR1677 and allows conversion of a.out relocs to coff relocs. * coffcode.h (coff_write_relocs): if supplied a relocation relative to an absolute symbol, use the right symbol index. * reloc.c (bfd_perform_relocation): do a partial link for coff relocs right.
1992-06-22Fri Jun 19 20:23:21 1992 Steve Chamberlain (sac@thepub.cygnus.com)Steve Chamberlain1-5/+5
Lints for bfd_reloc_code_type->bfd_reloc_code_real_type, and correct calling of howto special functions and fixes from Raeburn for gas<>bfdness * archures.c: nuke bfd_reloc_code_type * bout.c, cpu-h8300.c, coff-i960.c, coff-m88k.c: special function lint * coffcode.h (styp_to_sec_flags): STYP_INFO is marked as SEC_NEVER_LOAD, various other bfdgas newness * reloc.c->libbfd.h: change protype of bfd_default_reloc_type_lookup * targets.c: change jump table vector to above
1992-05-26Lots of changes from gas-bfd work. Includes:Ken Raeburn1-16/+62
* working reloc lookup support * better support for creation of COFF files from scratch * misc doc changes, macro tweaks, "const" additions, typo fixes, etc. * one or two ugly kludges that should get cleaned up (but what's one or two more, in BFD?) See ChangeLog for details.
1992-04-29 * aoutx.h (aout_swap_ext_reloc_out, aout_swap_std_reloc_out)Steve Chamberlain1-79/+84
bout.c (b_out_squirt_out_relocs): treat abs sumbols the right way. * reloc.c (bfd_perform-relocation): don't relocate refs to absolute symbols if doing a partial link.
1992-02-07Fluff removal.Steve Chamberlain1-0/+28
1992-01-24Uses the new small reloc type now.Steve Chamberlain1-434/+457
Currently self hosts on sun4 and sun3
1991-12-01New documentation styleSteve Chamberlain1-297/+374
1991-10-05Fri Oct 4 17:38:03 1991 Steve Chamberlain (steve at cygnus.com)Steve Chamberlain1-1/+1
* reloc.c: Extended NEWHOWTO macro * ieee.c: Changed the way 8bit pcrel is done * cpu-h8300.c: got the registers in the right order
1991-10-03* fixed prototype for reloc_type_lookupSteve Chamberlain1-0/+65
1991-10-01Added new macro NEWHOWTOSteve Chamberlain1-0/+28
1991-09-28Typos.John Gilmore1-2/+2
1991-09-26Fix bfd_perform_relocation to handle pc-relative relocs better.Per Bothner1-4/+4
1991-08-19Fixed minor typos.Roland Pesch1-1/+1
1991-08-19Mon Aug 19 13:48:22 1991 Roland H. Pesch (pesch at cygint.cygnus.com)Roland Pesch1-5/+5
* aoutx.h, archive.c, archures.c, bfd.c, bfd.texinfo, cache.c, coffcode.h, core.c, format.c, libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c, syms.c, targets.c (documentation segments): used BFD (caps) more consistently as a name in discourse, fixed a few other minor typos and uses of fonts
1991-08-17DocumentationSteve Chamberlain1-14/+46
1991-07-15* aoutf1.h archive.c bfd.c coffcode.h core.c ecoff.c ieee.cSteve Chamberlain1-1/+1
bfd.texinfo oasys.c opncls.c reloc.c srec.c: More documentation on lint fixes. * amdcoff.c bfd.texinfo Makefile.in : Folded in changes for amd 29k coff by David Wood (wood@lab.ultra.nyu.edu).
1991-07-04Initial revisionSteve Chamberlain1-0/+612