summaryrefslogtreecommitdiffstats
path: root/libebl/eblobjnotetypename.c
diff options
context:
space:
mode:
Diffstat (limited to 'libebl/eblobjnotetypename.c')
-rw-r--r--libebl/eblobjnotetypename.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/libebl/eblobjnotetypename.c b/libebl/eblobjnotetypename.c
index 8cdd7819..29a5391c 100644
--- a/libebl/eblobjnotetypename.c
+++ b/libebl/eblobjnotetypename.c
@@ -1,5 +1,5 @@
/* Return note type name.
- Copyright (C) 2002, 2007, 2009, 2011, 2016 Red Hat, Inc.
+ Copyright (C) 2002, 2007, 2009, 2011, 2016, 2018 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -79,6 +79,29 @@ ebl_object_note_type_name (Ebl *ebl, const char *name, uint32_t type,
}
}
+ if (strncmp (name, ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX,
+ strlen (ELF_NOTE_GNU_BUILD_ATTRIBUTE_PREFIX)) == 0)
+ {
+ /* GNU Build Attribute notes (ab)use the owner name to store
+ most of their data. Don't decode everything here. Just
+ the type.*/
+ char *t = buf;
+ const char *gba = "GNU Build Attribute";
+ int w = snprintf (t, len, "%s ", gba);
+ t += w;
+ len -= w;
+ if (type == NT_GNU_BUILD_ATTRIBUTE_OPEN)
+ w = snprintf (t, len, "OPEN");
+ else if (type == NT_GNU_BUILD_ATTRIBUTE_FUNC)
+ w = snprintf (t, len, "FUNC");
+ else
+ w = snprintf (t, len, "%x", type);
+ t += w;
+ len -= w;
+
+ return buf;
+ }
+
if (strcmp (name, "GNU") != 0)
{
/* NT_VERSION is special, all data is in the name. */