aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-alpha.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-02-16 19:29:01 +0000
committerIan Lance Taylor <ian@airs.com>1996-02-16 19:29:01 +0000
commitcba3f8a9bec5271063c4ef6671147b5b4a7a6024 (patch)
tree2b7eef09119cbd65fe8bdf41aa3a659b10f031b9 /bfd/coff-alpha.c
parent803108ab644ab1ee4bcfb9afb65ccef725c27f01 (diff)
downloadgdb-cba3f8a9bec5271063c4ef6671147b5b4a7a6024.zip
gdb-cba3f8a9bec5271063c4ef6671147b5b4a7a6024.tar.gz
gdb-cba3f8a9bec5271063c4ef6671147b5b4a7a6024.tar.bz2
* bfd.c (_bfd_get_gp_value): New function.
(_bfd_set_gp_value): New function. * libbfd-in.h (_bfd_get_gp_value): Declare. (_bfd_set_gp_value): Declare. * libbfd.h: Rebuild. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Use _bfd_get_gp_value and _bfd_set_gp_value rather than referring directly to the fields in the tdata information. (alpha_relocate_section): Likewise. * coff-mips.c (mips_adjust_reloc_in): Likewise. (mips_gprel_reloc): Likewise. (mips_relocate_section): Likewise. * elf32-mips.c (mips_elf_hi16_reloc): Likewise. (mips_elf_lo16_reloc): Likewise. (mips_elf_final_gp): Likewise. (mips_elf_gprel16_reloc): Likewise. (mips_elf_gprel32_reloc): Likewise. (mips_elf_relocate_section): Likewise. (mips_elf_finish_dynamic_symbol): Likewise. PR 8449.
Diffstat (limited to 'bfd/coff-alpha.c')
-rw-r--r--bfd/coff-alpha.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c
index 1bbec4c..67dc002 100644
--- a/bfd/coff-alpha.c
+++ b/bfd/coff-alpha.c
@@ -1,5 +1,5 @@
/* BFD back-end for ALPHA Extended-Coff files.
- Copyright 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
Modified from coff-mips.c by Steve Chamberlain <sac@cygnus.com> and
Ian Lance Taylor <ian@cygnus.com>.
@@ -785,7 +785,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
/* Get the GP value for the output BFD. */
gp_undefined = false;
- if (ecoff_data (abfd)->gp == 0)
+ if (_bfd_get_gp_value (abfd) == 0)
{
if (relocateable != false)
{
@@ -804,7 +804,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
|| strcmp (sec->name, ".lita") == 0))
lo = sec->vma;
}
- ecoff_data (abfd)->gp = lo + 0x8000;
+ _bfd_set_gp_value (abfd, lo + 0x8000);
}
else
{
@@ -816,12 +816,13 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
|| h->type != bfd_link_hash_defined)
gp_undefined = true;
else
- ecoff_data (abfd)->gp = (h->u.def.value
- + h->u.def.section->output_section->vma
- + h->u.def.section->output_offset);
+ _bfd_set_gp_value (abfd,
+ (h->u.def.value
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset));
}
}
- gp = ecoff_data (abfd)->gp;
+ gp = _bfd_get_gp_value (abfd);
for (; *reloc_vector != (arelent *) NULL; reloc_vector++)
{
@@ -1430,7 +1431,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
output, the .lita section is limited to 64KB. . */
lita_sec = symndx_to_section[RELOC_SECTION_LITA];
- gp = ecoff_data (output_bfd)->gp;
+ gp = _bfd_get_gp_value (output_bfd);
if (! info->relocateable && lita_sec != NULL)
{
struct ecoff_section_tdata *lita_sec_data;
@@ -1489,7 +1490,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
lita_sec_data->gp = gp;
}
- ecoff_data (output_bfd)->gp = gp;
+ _bfd_set_gp_value (output_bfd, gp);
}
gp_undefined = (gp == 0);
@@ -1979,7 +1980,8 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
input_bfd, input_section, r_vaddr - input_section->vma)))
return false;
/* Only give the error once per link. */
- ecoff_data (output_bfd)->gp = gp = 4;
+ gp = 4;
+ _bfd_set_gp_value (output_bfd, gp);
gp_undefined = false;
}
}
@@ -2257,7 +2259,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
alpha_ecoff_mkobject_hook, _bfd_ecoff_styp_to_sec_flags,
_bfd_ecoff_set_alignment_hook, _bfd_ecoff_slurp_symbol_table,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
},
/* Supported architecture. */
bfd_arch_alpha,