diff options
author | Alan Modra <amodra@gmail.com> | 2023-01-06 22:38:33 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-01-10 09:15:51 +1030 |
commit | 5a671d7a854b4e4cf31837e423419654139a482d (patch) | |
tree | 51f14ea818bc98f6ba8343b4d4411d4bd929dcf3 /bfd/ecoff.c | |
parent | b1c95bc4dd737d3d0a6c9a1b6e022e3ef85110bc (diff) | |
download | gdb-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/ecoff.c')
-rw-r--r-- | bfd/ecoff.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bfd/ecoff.c b/bfd/ecoff.c index 228394a..717d2fa 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -109,6 +109,21 @@ _bfd_ecoff_mkobject_hook (bfd *abfd, void * filehdr, void * aouthdr) return (void *) ecoff; } +bool +_bfd_ecoff_close_and_cleanup (bfd *abfd) +{ + struct ecoff_tdata *tdata = ecoff_data (abfd); + + if (tdata != NULL && bfd_get_format (abfd) == bfd_object) + while (tdata->mips_refhi_list != NULL) + { + struct mips_hi *ref = tdata->mips_refhi_list; + tdata->mips_refhi_list = ref->next; + free (ref); + } + return _bfd_generic_close_and_cleanup (abfd); +} + /* Initialize a new section. */ bool |