aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-sh.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-02-08 23:51:04 +1030
committerAlan Modra <amodra@gmail.com>2023-02-09 09:40:51 +1030
commitec78da9ce6540bdcc2aeb3e01ffdbbac957cbe07 (patch)
tree1f07d4e070c91822a94d687361aefd15428ce25e /bfd/coff-sh.c
parent389903128ac5686dc83efd121339158465614d67 (diff)
downloadbinutils-ec78da9ce6540bdcc2aeb3e01ffdbbac957cbe07.zip
binutils-ec78da9ce6540bdcc2aeb3e01ffdbbac957cbe07.tar.gz
binutils-ec78da9ce6540bdcc2aeb3e01ffdbbac957cbe07.tar.bz2
coff-sh.c keep_relocs, keep_contents and keep_syms
keep_relocs and keep_contents are unused nowadays except by xcofflink.c, and I can't see a reason why keep_syms needs to be set. The external syms are read and used by sh_relax_section and used by sh_relax_delete_bytes. There doesn't appear to be any way that freeing them will cause trouble. * coff-sh.c (sh_relax_section): Don't set keep_relocs, keep_contents or keep_syms. (sh_relax_delete_bytes): Don't set keep_contents.
Diffstat (limited to 'bfd/coff-sh.c')
-rw-r--r--bfd/coff-sh.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c
index cc6faac..314b796 100644
--- a/bfd/coff-sh.c
+++ b/bfd/coff-sh.c
@@ -905,12 +905,7 @@ sh_relax_section (bfd *abfd,
the linker is run. */
coff_section_data (abfd, sec)->relocs = internal_relocs;
- coff_section_data (abfd, sec)->keep_relocs = true;
-
coff_section_data (abfd, sec)->contents = contents;
- coff_section_data (abfd, sec)->keep_contents = true;
-
- obj_coff_keep_syms (abfd) = true;
/* Replace the jsr with a bsr. */
@@ -1027,12 +1022,7 @@ sh_relax_section (bfd *abfd,
if (swapped)
{
coff_section_data (abfd, sec)->relocs = internal_relocs;
- coff_section_data (abfd, sec)->keep_relocs = true;
-
coff_section_data (abfd, sec)->contents = contents;
- coff_section_data (abfd, sec)->keep_contents = true;
-
- obj_coff_keep_syms (abfd) = true;
}
}
@@ -1435,8 +1425,6 @@ sh_relax_delete_bytes (bfd *abfd,
if (val > addr && val < toaddr)
bfd_put_32 (abfd, val - count,
ocontents + irelscan->r_vaddr - o->vma);
-
- coff_section_data (abfd, o)->keep_contents = true;
}
}
}