mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-18 16:57:56 +08:00
binary outsymbols
This fixes leaks of outsymbols for various targets that use the generic linker. The key fix here is to not generate output symbols for targets that won't ever write symbols, and of course to free outsymbols after they've been written in targets that do. Target vector object_flags and section_flags are updated to better reflect target capabilities, in particular not setting HAS_SYMS or SEC_RELOC when the target does not support symbols or relocs. * binary.c (binary_vec): Update section_flags. * linker.c (generic_add_output_symbol): Don't add to outsymbols if !HAS_SYMS. * srec.c (srec_write_symbols): Free outsymbols on return. (srec_vec): Update object_flags and section_flags. (symbolsrec_vec): Likewise. * tekhex.c (tekhex_write_object_contents): Free outsymbols on return. (tekhex_vec): Update object_flags and section_flags. * verilog.c (verilog_vec): Likewise.
This commit is contained in:
@@ -384,11 +384,9 @@ const bfd_target verilog_vec =
|
||||
bfd_target_verilog_flavour,
|
||||
BFD_ENDIAN_UNKNOWN, /* Target byte order. */
|
||||
BFD_ENDIAN_UNKNOWN, /* Target headers byte order. */
|
||||
(HAS_RELOC | EXEC_P | /* Object flags. */
|
||||
HAS_LINENO | HAS_DEBUG |
|
||||
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
|
||||
EXEC_P, /* Object flags. */
|
||||
(SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
|
||||
| SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
|
||||
| SEC_ALLOC | SEC_LOAD), /* Section flags. */
|
||||
0, /* Leading underscore. */
|
||||
' ', /* AR_pad_char. */
|
||||
16, /* AR_max_namelen. */
|
||||
|
||||
Reference in New Issue
Block a user