This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils 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]

Re: [PATCH] readelf: Accept version 8 .gdb_index section format. Fix memory leak.


On Mon, 18 Mar 2013 13:55:39 +0100, Mark Wielaard wrote:
> Version 8 just indicates that if the .gdb_index was generated by the gold
> linker it correctly includes TUs for symbols. http://sourceware.org/PR15021
> Also fix memory leak by freeing the return value of format_dwarf_addr.
[...]
> @@ -7272,8 +7272,9 @@ print_gdb_index_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
>  
>    // The only difference between version 4 and version 5 is the
>    // hash used for generating the table.  Version 6 contains symbols
> -  // for inlined functions, older versions didn't.
> -  if (vers < 4 || vers > 7)
> +  // for inlined functions, older versions didn't.  Version 7 adds
> +  // symbol kinds.
> +  if (vers < 4 || vers > 8)

Here could be copy-pasted the difference of version 8 from your mail above.
(GDB also does not have one as I see.)


>      {
>        printf (gettext ("  unknown version, cannot parse section\n"));
>        return;
> @@ -7387,6 +7388,8 @@ print_gdb_index_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr,
>        char *h = format_dwarf_addr (dwflmod, 8, high - 1, high);
>        printf (" [%4zu] %s..%s, CU index: %5" PRId32 "\n",
>  	      n, l, h, idx);
> +      free (l);
> +      free (h);
>        n++;

This is really very unrelated (->separate) patch.


Jan

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]