diff options
author | Alan Modra <amodra@gmail.com> | 2023-02-09 12:08:10 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-02-09 20:07:55 +1030 |
commit | c920e5cc604c5b20f9af7c75402eea94aa1e11c6 (patch) | |
tree | e587f40d85d4a84aa9390b60744dcfb1b74f5811 /bfd/peicode.h | |
parent | 0d78a4c40eaa1b709e482044c17ce6d0f05b2f9c (diff) | |
download | binutils-gdb-c920e5cc604c5b20f9af7c75402eea94aa1e11c6.tar.gz |
coff keep_relocs and keep_contents
keep_relocs is set by pe_ILF_save_relocs but not used anywhere in the
coff/pe code. It is tested by the xcoff backend but not set.
keep_contents is only used by the xcoff backend when dealing with
the .loader section, and it's easy enough to dispense with it there.
keep_contents is set in various places but that's fairly useless when
the contents aren't freed anyway until later linker support functions,
add_dynamic_symbols and check_dynamic_ar_symbols. There the contents
were freed if keep_contents wasn't set. I reckon we can free them
unconditionally.
* coff-bfd.h (struct coff_section_tdata): Delete keep_relocs
and keep_contents.
* peicode.h (pe_ILF_save_relocs): Don't set keep_relocs.
* xcofflink.c (xcoff_get_section_contents): Cache contents.
Return the contents. Update callers.
(_bfd_xcoff_canonicalize_dynamic_symtab): Don't set
keep_contents for .loader.
(xcoff_link_add_dynamic_symbols): Free .loader contents
unconditionally.
(xcoff_link_check_dynamic_ar_symbols): Likewise.
Diffstat (limited to 'bfd/peicode.h')
-rw-r--r-- | bfd/peicode.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/bfd/peicode.h b/bfd/peicode.h index fef7d0dd69b..43226caf00e 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -526,7 +526,6 @@ pe_ILF_save_relocs (pe_ILF_vars * vars, abort (); coff_section_data (vars->abfd, sec)->relocs = vars->int_reltab; - coff_section_data (vars->abfd, sec)->keep_relocs = true; sec->relocation = vars->reltab; sec->reloc_count = vars->relcount; |