The 'debugaltlink_name_len =+ 1' bug reported in PR89136 exposes the fact that
the build-id is not verified for the .gnu_debugaltlink.
Fix both problems.
2019-01-31 Tom de Vries <tdevries@suse.de>
PR libbacktrace/89136
* elf.c (elf_add): Read build-id if with_buildid_data. Fix
'debugaltlink_name_len =+ 1'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268419
138bc75d-0d04-0410-961f-
82ee72b054a4
+2019-01-31 Tom de Vries <tdevries@suse.de>
+
+ PR libbacktrace/89136
+ * elf.c (elf_add): Read build-id if with_buildid_data. Fix
+ 'debugaltlink_name_len =+ 1'.
+
2019-01-29 Tom de Vries <tdevries@suse.de>
* install-debuginfo-for-buildid.sh.in: New script.
/* Read the build ID if present. This could check for any
SHT_NOTE section with the right note name and type, but gdb
looks for a specific section name. */
- if (!debuginfo
+ if ((!debuginfo || with_buildid_data != NULL)
&& !buildid_view_valid
&& strcmp (name, ".note.gnu.build-id") == 0)
{
if (debugaltlink_name_len < shdr->sh_size)
{
/* Include terminating zero. */
- debugaltlink_name_len =+ 1;
+ debugaltlink_name_len += 1;
debugaltlink_buildid_data
= debugaltlink_data + debugaltlink_name_len;