aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-mips.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-03-22 00:27:05 +0000
committerIan Lance Taylor <ian@airs.com>1994-03-22 00:27:05 +0000
commitf1cca64780428243ea7d62192a2395a60cb90263 (patch)
tree3fb2922fd51faed0c4fe6e0e8555a593f7620c92 /bfd/coff-mips.c
parent4fdbafb247bd7a1af8c22d6da0acc560aa16d05a (diff)
downloadfsf-binutils-gdb-f1cca64780428243ea7d62192a2395a60cb90263.zip
fsf-binutils-gdb-f1cca64780428243ea7d62192a2395a60cb90263.tar.gz
fsf-binutils-gdb-f1cca64780428243ea7d62192a2395a60cb90263.tar.bz2
Support for link_order types which generate relocs in order to
support -Ur in the linker. * linker.c (generic_link_add_symbol_list): Remove bitsize argument from call to _bfd_generic_link_add_one_symbol. (_bfd_generic_link_add_one_symbol): Remove bitsize argument. Don't pass bitsize to constructor call back. Pass BFD_RELOC_CTOR instead of bitsize to add_to_set call back. (_bfd_generic_final_link): Account for link_order relocs when allocating space for relocations. Handle them in link_order loop. (_bfd_generic_reloc_link_order): New function. (_bfd_default_link_order): If a reloc_link_order is seen here, abort. (_bfd_count_link_order_relocs): New function. * libbfd-in.h (_bfd_generic_link_add_one_symbol): Remove bitsize argument from declaration. (_bfd_generic_reloc_link_order): Declare. (_bfd_count_link_order_relocs): Declare. * libbfd.h: Rebuilt. * aoutx.h (aout_link_add_symbols): Remove bitsize argument from call to _bfd_generic_link_add_one_symbol. (NAME(aout,final_link)): Account for link_order relocs when allocating space for relocations. Handle them after handling all input BFDs. (aout_link_reloc_link_order): New function. * ecoff.c (ecoff_link_add_externals): Remove bitsize argument from call to _bfd_generic_link_add_one_symbol. (ecoff_bfd_final_link): Account for link_order relocs when allocating space for relocations. Handle them in link_order loop. (ecoff_link_write_external): Set the storage class of a defined linker created symbol based on the section it is in. Correct bfd_link_hash_weak case to use .sc rather than .st. (ecoff_reloc_link_order): New function. * coff-alpha.c (alpha_bfd_reloc_type_lookup): Handle BFD_RELOC_CTOR. * coff-mips.c (mips_bfd_reloc_type_lookup): Likewise.
Diffstat (limited to 'bfd/coff-mips.c')
-rw-r--r--bfd/coff-mips.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c
index a9939c8..a9a95e5 100644
--- a/bfd/coff-mips.c
+++ b/bfd/coff-mips.c
@@ -697,6 +697,7 @@ mips_bfd_reloc_type_lookup (abfd, code)
mips_type = MIPS_R_REFHALF;
break;
case BFD_RELOC_32:
+ case BFD_RELOC_CTOR:
mips_type = MIPS_R_REFWORD;
break;
case BFD_RELOC_MIPS_JMP:
@@ -798,7 +799,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
* sizeof (asection *))));
if (!symndx_to_section)
{
- bfd_error = no_memory;
+ bfd_set_error (bfd_error_no_memory);
return false;
}
@@ -903,7 +904,8 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
/* The GPREL reloc uses an addend: the difference in the GP
values. */
- if (int_rel.r_type != MIPS_R_GPREL)
+ if (int_rel.r_type != MIPS_R_GPREL
+ && int_rel.r_type != MIPS_R_LITERAL)
addend = 0;
else
{