This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
This patch fixes a memory leak of sorts in bfd_elf_get_str_section that happens if the symbol string table is corrupt (e.g., it can't be read from the file because the file has been truncated). Without the patch, bfd will attempt to read the whole symbol string table for the first symbol, fail, set the cached contents to NULL, then try again for the second symbol, and so on. Each time, space for the string table is allocated in the bfd structure. It would all get freed eventually, but not until the bfd is closed. For a file with thousands of symbols and a huge string table, bfd ends up using enormous amounts of memory just to do a simple nm. * elf.c (bfd_elf_get_str_section): Fix memory leak caused by corrupt string table. i386: === binutils Summary === # of expected passes 101 # of expected failures 2 x86_64: === binutils Summary === # of expected passes 47 # of expected failures 1 OK to commit? -cary
Attachment:
corrupt-strtab-patch.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |