[PATCH] Pretty-printing plt entries on ARM

Pavel Fedin p.fedin@samsung.com
Thu Mar 6 10:58:00 GMT 2014


 Hello!

> 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'.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia




More information about the Binutils mailing list