This is the mail archive of the
mailing list for the binutils project.
RE: [PATCH] Pretty-printing plt entries on ARM
- From: Pavel Fedin <p dot fedin at samsung dot com>
- To: 'Yury Gribov' <y dot gribov at samsung dot com>, binutils at sourceware dot org
- Cc: 'Viacheslav Garbuzov' <v dot garbuzov at samsung dot com>
- Date: Thu, 06 Mar 2014 14:58:33 +0400
- Subject: RE: [PATCH] Pretty-printing plt entries on ARM
- Authentication-results: sourceware.org; auth=none
- References: <53184339 dot 1070606 at samsung dot com>
> The attached patches implements draft support for pretty-printing
> elements of .plt on ARM targets. I'm not sure whether design is sane
> and I'm open for suggestions from Binutils gurus.
IMHO - overcomplicated without the need. I see the following flaws:
1. It is better to use plt->contents for caching because clients (binutils
or gdb) will later read contents of the section in order to display it. If
you study bfd_get_full_section_contents() flow control a bit better, you'll
see that if plt->contents is present, it will not reload it from file but
return cached data instead.
2. In your implementation nobody will deallocate both context and cached
data. If _bfd_elf_get_synthetic_symtab() is called more than once, this will
produce a memory leak.
It is perfectly okay to cache data in plt->contents (using official
bfd_cache_section_contents()) and then you'll need to carry over only offset
as your 'context'.
Samsung Electronics Research center Russia