aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-mips.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-01-06 22:38:33 +1030
committerAlan Modra <amodra@gmail.com>2023-01-10 09:15:51 +1030
commit5a671d7a854b4e4cf31837e423419654139a482d (patch)
tree51f14ea818bc98f6ba8343b4d4411d4bd929dcf3 /bfd/coff-mips.c
parentb1c95bc4dd737d3d0a6c9a1b6e022e3ef85110bc (diff)
downloadgdb-5a671d7a854b4e4cf31837e423419654139a482d.zip
gdb-5a671d7a854b4e4cf31837e423419654139a482d.tar.gz
gdb-5a671d7a854b4e4cf31837e423419654139a482d.tar.bz2
Move mips_refhi_list to bfd tdata
Similar to commit c799eddb3512, but for mips-ecoff. mips-ecoff is marked obsolete, but we still allow reading of these object files in a number of mips targets. * coff-mips.c (struct mips_hi, mips_refhi_list): Delete. (mips_refhi_reloc, mips_reflo_reloc): Access mips_refhi_list in ecoff_data. * ecoff.c (_bfd_ecoff_close_and_cleanup): New function. * libecoff.h (struct mips_hi): Moved from coff-mips.c. (struct ecoff_tdata): Add mips_refhi_list. (_bfd_ecoff_close_and_cleanup): Declare.
Diffstat (limited to 'bfd/coff-mips.c')
-rw-r--r--bfd/coff-mips.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c
index 79cbc20..fdc0771 100644
--- a/bfd/coff-mips.c
+++ b/bfd/coff-mips.c
@@ -423,19 +423,8 @@ mips_generic_reloc (bfd *abfd ATTRIBUTE_UNUSED,
reloc. This extension permits gcc to output the HI and LO relocs
itself. */
-struct mips_hi
-{
- struct mips_hi *next;
- bfd_byte *addr;
- bfd_vma addend;
-};
-
-/* FIXME: This should not be a static variable. */
-
-static struct mips_hi *mips_refhi_list;
-
static bfd_reloc_status_type
-mips_refhi_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+mips_refhi_reloc (bfd *abfd,
arelent *reloc_entry,
asymbol *symbol,
void * data,
@@ -480,8 +469,8 @@ mips_refhi_reloc (bfd *abfd ATTRIBUTE_UNUSED,
return bfd_reloc_outofrange;
n->addr = (bfd_byte *) data + reloc_entry->address;
n->addend = relocation;
- n->next = mips_refhi_list;
- mips_refhi_list = n;
+ n->next = ecoff_data (abfd)->mips_refhi_list;
+ ecoff_data (abfd)->mips_refhi_list = n;
if (output_bfd != (bfd *) NULL)
reloc_entry->address += input_section->output_offset;
@@ -502,11 +491,11 @@ mips_reflo_reloc (bfd *abfd,
bfd *output_bfd,
char **error_message)
{
- if (mips_refhi_list != NULL)
+ if (ecoff_data (abfd)->mips_refhi_list != NULL)
{
struct mips_hi *l;
- l = mips_refhi_list;
+ l = ecoff_data (abfd)->mips_refhi_list;
while (l != NULL)
{
unsigned long insn;
@@ -549,7 +538,7 @@ mips_reflo_reloc (bfd *abfd,
l = next;
}
- mips_refhi_list = NULL;
+ ecoff_data (abfd)->mips_refhi_list = NULL;
}
/* Now do the REFLO reloc in the usual way. */