[binutils-gdb] goodbye aout_section_data
Alan Modra
amodra@sourceware.org
Mon Dec 16 10:59:18 GMT 2024
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c32881686b0750ef441816cc8b211fbe8790f513
commit c32881686b0750ef441816cc8b211fbe8790f513
Author: Alan Modra <amodra@gmail.com>
Date: Mon Dec 16 18:08:54 2024 +1030
goodbye aout_section_data
aout_section_data->relocs isn't set by anything, so delete it.
Diff:
---
bfd/aoutx.h | 17 +++++------------
bfd/libaout.h | 15 ---------------
bfd/pdp11.c | 17 +++++------------
3 files changed, 10 insertions(+), 39 deletions(-)
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 5f62ac67cfd..2639655c7f9 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -4723,19 +4723,12 @@ aout_link_input_section (struct aout_final_link_info *flaginfo,
(file_ptr) 0, input_size))
return false;
- /* Read in the relocs if we haven't already done it. */
- if (aout_section_data (input_section) != NULL
- && aout_section_data (input_section)->relocs != NULL)
- relocs = aout_section_data (input_section)->relocs;
- else
+ relocs = flaginfo->relocs;
+ if (rel_size > 0)
{
- relocs = flaginfo->relocs;
- if (rel_size > 0)
- {
- if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
- || bfd_read (relocs, rel_size, input_bfd) != rel_size)
- return false;
- }
+ if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
+ || bfd_read (relocs, rel_size, input_bfd) != rel_size)
+ return false;
}
/* Relocate the section contents. */
diff --git a/bfd/libaout.h b/bfd/libaout.h
index 05b5e13bcd8..abdabfa8902 100644
--- a/bfd/libaout.h
+++ b/bfd/libaout.h
@@ -449,21 +449,6 @@ struct aout_data_struct
macro is only ever applied to an asymbol. */
#define aout_symbol(asymbol) ((aout_symbol_type *)(&(asymbol)->the_bfd))
-/* Information we keep for each a.out section. This is currently only
- used by the a.out backend linker. */
-
-struct aout_section_data_struct
-{
- /* The unswapped relocation entries for this section. */
- void * relocs;
-};
-
-#define aout_section_data(s) \
- ((struct aout_section_data_struct *) (s)->used_by_bfd)
-
-#define set_aout_section_data(s,v) \
- ((s)->used_by_bfd = (void *)&(v)->relocs)
-
/* Prototype declarations for functions defined in aoutx.h. */
extern bool NAME (aout, squirt_out_relocs)
diff --git a/bfd/pdp11.c b/bfd/pdp11.c
index f65760f9ee6..8fa3a545761 100644
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -3655,19 +3655,12 @@ aout_link_input_section (struct aout_final_link_info *flaginfo,
(file_ptr) 0, input_size))
return false;
- /* Read in the relocs if we haven't already done it. */
- if (aout_section_data (input_section) != NULL
- && aout_section_data (input_section)->relocs != NULL)
- relocs = aout_section_data (input_section)->relocs;
- else
+ relocs = flaginfo->relocs;
+ if (rel_size > 0)
{
- relocs = flaginfo->relocs;
- if (rel_size > 0)
- {
- if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
- || bfd_read (relocs, rel_size, input_bfd) != rel_size)
- return false;
- }
+ if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
+ || bfd_read (relocs, rel_size, input_bfd) != rel_size)
+ return false;
}
/* Relocate the section contents. */
More information about the Binutils-cvs
mailing list