* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Don't

assume that we can set the GP value and then get the same value,
	since it won't be true if the output file is neither ELF nor
	ECOFF.
	* coff-mips.c (mips_adjust_reloc_in): Don't bother to use
	_bfd_get_gp_value here.
	(mips_gprel_reloc): Don't assume we can set and get the GP value.
	* elf32-mips.c (mips_elf_hi16_reloc): Get gp value from
	mips_elf_final_gp.
	(mips_elf_lo16_reloc): Likewise.
	(mips_elf_final_gp): Add pgp parameter.  Set it to the GP value.
	Don't require that the BFD be ELF.
	(mips_elf_gprel16_reloc): Get gp value from mips_elf_final_gp.
	(mips_elf_gprel32_reloc): Likewise.
	(mips_elf_relocate_section): Don't assume we can set and get the
	GP value.
	(mips_elf_finish_dynamic_symbol): Don't bother to use
	_bfd_get_gp_value here.

	* elf32-mips.c (mips_elf_create_procedure_table): Initialize sv.
	Don't change epdr between malloc and free.  Be careful not to free
	NULL pointers.  Zero out the first RPDR.
This commit is contained in:
Ian Lance Taylor 1996-02-19 21:12:48 +00:00
parent 0708e99fc2
commit 81bdcecf63
2 changed files with 34 additions and 7 deletions

View File

@ -1,5 +1,28 @@
Mon Feb 19 12:37:41 1996 Ian Lance Taylor <ian@cygnus.com>
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Don't
assume that we can set the GP value and then get the same value,
since it won't be true if the output file is neither ELF nor
ECOFF.
* coff-mips.c (mips_adjust_reloc_in): Don't bother to use
_bfd_get_gp_value here.
(mips_gprel_reloc): Don't assume we can set and get the GP value.
* elf32-mips.c (mips_elf_hi16_reloc): Get gp value from
mips_elf_final_gp.
(mips_elf_lo16_reloc): Likewise.
(mips_elf_final_gp): Add pgp parameter. Set it to the GP value.
Don't require that the BFD be ELF.
(mips_elf_gprel16_reloc): Get gp value from mips_elf_final_gp.
(mips_elf_gprel32_reloc): Likewise.
(mips_elf_relocate_section): Don't assume we can set and get the
GP value.
(mips_elf_finish_dynamic_symbol): Don't bother to use
_bfd_get_gp_value here.
* elf32-mips.c (mips_elf_create_procedure_table): Initialize sv.
Don't change epdr between malloc and free. Be careful not to free
NULL pointers. Zero out the first RPDR.
* configure.host: On Linux, only pass -rpath option if $(libdir)
is neither /lib nor /usr/lib. From Alan Modra
<alan@mullet.Levels.UniSA.Edu.Au>.

View File

@ -759,6 +759,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
bfd *output_bfd = relocateable ? abfd : (bfd *) NULL;
bfd_vma gp;
boolean gp_undefined;
bfd_vma gp;
bfd_vma stack[RELOC_STACKSIZE];
int tos = 0;
@ -785,7 +786,8 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
/* Get the GP value for the output BFD. */
gp_undefined = false;
if (_bfd_get_gp_value (abfd) == 0)
gp = _bfd_get_gp_value (abfd);
if (gp == 0)
{
if (relocateable != false)
{
@ -804,7 +806,8 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
|| strcmp (sec->name, ".lita") == 0))
lo = sec->vma;
}
_bfd_set_gp_value (abfd, lo + 0x8000);
gp = lo + 0x8000;
_bfd_set_gp_value (abfd, gp);
}
else
{
@ -816,13 +819,14 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
|| h->type != bfd_link_hash_defined)
gp_undefined = true;
else
_bfd_set_gp_value (abfd,
(h->u.def.value
+ h->u.def.section->output_section->vma
+ h->u.def.section->output_offset));
{
gp = (h->u.def.value
+ h->u.def.section->output_section->vma
+ h->u.def.section->output_offset);
_bfd_set_gp_value (abfd, gp);
}
}
}
gp = _bfd_get_gp_value (abfd);
for (; *reloc_vector != (arelent *) NULL; reloc_vector++)
{