This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][PR other/86198] Libacktrace and ".note.gnu.build-id" section.
- From: Denis Khalikov <d dot khalikov at partner dot samsung dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Ian Lance Taylor <iant at google dot com>, Maxim Ostapenko <m dot ostapenko at samsung dot com>, Vyacheslav Barinov <v dot barinov at samsung dot com>
- Date: Mon, 18 Jun 2018 21:35:12 +0300
- Subject: [PATCH][PR other/86198] Libacktrace and ".note.gnu.build-id" section.
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180618183515euoutp0277699f35173fa1cf654385571c149c33~5VOq44vmy1850418504euoutp02F
- References: <CGME20180618183513eucas1p15f94594f77bc3d50b9ebba0ada2b9009@eucas1p1.samsung.com>
Hello,
this is a patch for PR other/86198
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86198
Thanks.
From: Denis Khalikov <d.khalikov@partner.samsung.com>
Date: Mon, 18 Jun 2018 20:46:39 +0300
Subject: [PATCH] PR other/86198
* elf.c (elf_add): Increase ".note.gnu.build-id" section size
checking up to 36 bytes.
---
libbacktrace/ChangeLog | 6 ++++++
libbacktrace/elf.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog
index c01c7d8..2cc31bf 100644
--- a/libbacktrace/ChangeLog
+++ b/libbacktrace/ChangeLog
@@ -1,3 +1,9 @@
+2018-06-18 Denis Khalikov <d.khalikov@partner.samsung.com>
+
+ PR other/86198
+ * elf.c (elf_add): Increase ".note.gnu.build-id" section size
+ checking up to 36 bytes.
+
2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.
diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c
index 0fd5e6f..f4863f0 100644
--- a/libbacktrace/elf.c
+++ b/libbacktrace/elf.c
@@ -2868,7 +2868,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor,
if (note->type == NT_GNU_BUILD_ID
&& note->namesz == 4
&& strncmp (note->name, "GNU", 4) == 0
- && shdr->sh_size < 12 + ((note->namesz + 3) & ~ 3) + note->descsz)
+ && shdr->sh_size <= 12 + ((note->namesz + 3) & ~ 3) + note->descsz)
{
buildid_data = ¬e->name[0] + ((note->namesz + 3) & ~ 3);
buildid_size = note->descsz;
--
1.9.1