aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-04-15 11:14:01 +0000
committerNick Clifton <nickc@redhat.com>2011-04-15 11:14:01 +0000
commite21e5835b606f4ef1eb42e99bf26a3e43cdf034a (patch)
tree484348d53366660bc3f14ee1e263d9e06ba47feb /bfd/elf.c
parent9c68f58e48030d125e085999b3778c22534e7bed (diff)
downloadgdb-e21e5835b606f4ef1eb42e99bf26a3e43cdf034a.zip
gdb-e21e5835b606f4ef1eb42e99bf26a3e43cdf034a.tar.gz
gdb-e21e5835b606f4ef1eb42e99bf26a3e43cdf034a.tar.bz2
* elf-bfd.h (struct sdt_note): New struct.
(struct elf_obj_tdata) <sdt_note_head>: New field. * elf.c (elfobj_grok_stapsdt_note_1): New function. (elfobj_grok_stapsdt_note): Likewise. (elf_parse_notes): Added code to treat SystemTap note sections. * common.h (NT_STAPSDT): New define.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 0bb0c5a..71de844 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -8417,6 +8417,35 @@ elfobj_grok_gnu_note (bfd *abfd, Elf_Internal_Note *note)
}
static bfd_boolean
+elfobj_grok_stapsdt_note_1 (bfd *abfd, Elf_Internal_Note *note)
+{
+ struct sdt_note *cur =
+ (struct sdt_note *) bfd_alloc (abfd, sizeof (struct sdt_note)
+ + note->descsz);
+
+ cur->next = (struct sdt_note *) (elf_tdata (abfd))->sdt_note_head;
+ cur->size = (bfd_size_type) note->descsz;
+ memcpy (cur->data, note->descdata, note->descsz);
+
+ elf_tdata (abfd)->sdt_note_head = cur;
+
+ return TRUE;
+}
+
+static bfd_boolean
+elfobj_grok_stapsdt_note (bfd *abfd, Elf_Internal_Note *note)
+{
+ switch (note->type)
+ {
+ case NT_STAPSDT:
+ return elfobj_grok_stapsdt_note_1 (abfd, note);
+
+ default:
+ return TRUE;
+ }
+}
+
+static bfd_boolean
elfcore_netbsd_get_lwpid (Elf_Internal_Note *note, int *lwpidp)
{
char *cp;
@@ -9189,6 +9218,12 @@ elf_parse_notes (bfd *abfd, char *buf, size_t size, file_ptr offset)
if (! elfobj_grok_gnu_note (abfd, &in))
return FALSE;
}
+ else if (in.namesz == sizeof "stapsdt"
+ && strcmp (in.namedata, "stapsdt") == 0)
+ {
+ if (! elfobj_grok_stapsdt_note (abfd, &in))
+ return FALSE;
+ }
break;
}